title: ruby array of structs
body: <p>I need to extract a tag value from <code>AWS EC2</code> using the <code>AWS ruby-sdk v2</code> to get information about instances.  The tags are manually set for the most part.</p>
  
  <p>When I get tags back from the following code:</p>
  
  <pre><code>ec2 = Aws::EC2::Resource.new(:region =&gt; us-east-1)
  ec2.instances.limit(10).each do |instance|  
    instance.tags.each do |tag|       
      puts tag   
    end
  end
  </code></pre>
  
  <p>I see:</p>
  
  <pre><code>#&lt;struct Aws::EC2::Types::Tag key="Owner", value="the_owner"&gt;
  #&lt;struct Aws::EC2::Types::Tag key="PurchaseOrder", value="90210"&gt;
  #&lt;struct Aws::EC2::Types::Tag key="Name", value="my_rocking_instance"&gt;
  #&lt;struct Aws::EC2::Types::Tag key="environment", value="staging"&gt;
  
  #&lt;struct Aws::EC2::Types::Tag key="Name", value="another_instance"&gt;
  #&lt;struct Aws::EC2::Types::Tag key="environment", value="prod"&gt;
  #&lt;struct Aws::EC2::Types::Tag key="PurchaseOrder", value="90210"&gt;
  #&lt;struct Aws::EC2::Types::Tag key="Owner", value="the_owner"&gt;
  </code></pre>
  
  <p>and so on.  I put a space between the two instances for clarity.  I tried a few tricks with arrays, hashes, etc. but this appears to be an array of structs which I haven't worked with yet.</p>
  
  <p>How do I extract only the <code>Name</code> tag value?</p>