title: Ruby Array Attributes
body: <p>I am trying to access the Shopify API using the shopify-api gem. In particular, I am trying to access the price of an item, which is contained in an array.</p>
  
  <pre><code>product = ShopifyAPI::Product.find(id)
  variant = product.variants
  </code></pre>
  
  <p><code>variant</code> here is an array, and when I do <code>puts variant.inspect</code>, I get</p>
  
  <pre><code>[
    #&lt;ShopifyAPI::Variant:0x000000041c9e50 @attributes={
      "id"=&gt;23923477191,
      "title"=&gt;"Default Title",
      "price"=&gt;"6.00",
      "sku"=&gt;"shirts",
      "position"=&gt;1,
      "grams"=&gt;0,
      "inventory_policy"=&gt;"deny",
      "compare_at_price"=&gt;nil,
      "fulfillment_service"=&gt;"manual",
      "inventory_management"=&gt;"shopify",
      "option1"=&gt;"Default Title",
      "option2"=&gt;nil,
      "option3"=&gt;nil,
      "created_at"=&gt;"2016-06-30T14:06:07-04:00",
      "updated_at"=&gt;"2016-07-16T19:00:07-04:00",
      "taxable"=&gt;true,
      "barcode"=&gt;"",
      "image_id"=&gt;nil,
      "inventory_quantity"=&gt;1,
      "weight"=&gt;0.0,
      "weight_unit"=&gt;"kg",
      "old_inventory_quantity"=&gt;1,
      "requires_shipping"=&gt;true
    }, @prefix_options={:product_id=&gt;7509869767}, @persisted=true&gt;
  ]
  </code></pre>
  
  <p>How do I access/change 'price' under '@attributes`?</p>