Select an element from a collection with a given pattern

# for example# Find the Ehningen, Germany regionregion=compute.locations.select{|loc|loc.location=="EHN"}.first# Choose the 32-bit Copper image from the list of available instances for this imageinstance_type=image.supported_instance_types.select{|img|img.label=='Copper 32 bit'}.first

1# for example

2

3# Find the Ehningen, Germany region

4region=compute.locations.select{|loc|loc.location=="EHN"}.first

5

6# Choose the 32-bit Copper image from the list of available instances for this image