title: Can anyone help me scrape the Amazon Products API using Ruby?
body: <p>I'm using the <a href="http://github.com/completelynovel/amazon-product-advertising-api" rel="nofollow noreferrer">amazon-product-advertising-api gem</a> and am following the <a href="http://github.com/completelynovel/amazon-product-advertising-api/blob/master/EXAMPLE.txt" rel="nofollow noreferrer">example code</a> to try and grab music album data.</p>
  
  <p>The code I have is as follows:</p>
  
  <pre><code>post '/mash' do
      username = params[:username]
  
      user = Scrobbler::User.new(username)
  
      @recommendations = user.recommendations
  
      @urls = { }
      @recommendations.each do |t|
          lookup = AmazonProductAdvertisingApi::Operations::Item::ItemSearch.new(t.name, search_index = "Music", region = :uk)
          lookup.run
  
          if lookup.is_valid
              title = lookup.response.items.first.item_attributes.title
              url = lookup.response.items.first.detail_page_url
              @urls[title] = url
          end
      end 
  
      haml :results
  end
  </code></pre>
  
  <p>However, I receive the following error:</p>
  
  <pre><code>NoMethodError at /mash
  undefined method `item_attributes' for nil:NilClass
  </code></pre>
  
  <p>When I do <code>put lookup.response.items.first</code> I get the following error/output:</p>
  
  <pre><code>TypeError at /mash
  #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1b80e38 @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1b80d34 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1b7eca0 @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB001J66K1M%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1M"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1b7ec14 @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B001J66K1M%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1M"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1b7eb60 @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B001J66K1M%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1M"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1b7eaac @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B001J66K1M%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1M"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Idle-Forest-Chit-Chat-Kinny/dp/B001J66K1M%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB001J66K1M", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1b7f81c @artist="Kinny", @manufacturer="Tru Thoughts", @title="Idle Forest of Chit Chat", @product_group="Music", @contained_elements=[]&gt;, @asin="B001J66K1M"&gt;
  </code></pre>
  
  <p>Which I assumed meant there is data there which I can access. </p>
  
  <p>The full <code>put lookup.response.items</code> shows:</p>
  
  <pre><code>TypeError at /mash
  #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a8e4e4 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a8cf68 @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a8ce64 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a8add0 @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB001J66K1M%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1M"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a8ad44 @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B001J66K1M%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1M"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a8ac90 @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B001J66K1M%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1M"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a8abdc @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B001J66K1M%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1M"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Idle-Forest-Chit-Chat-Kinny/dp/B001J66K1M%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB001J66K1M", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a8b94c @artist="Kinny", @manufacturer="Tru Thoughts", @title="Idle Forest of Chit Chat", @product_group="Music", @contained_elements=[]&gt;, @asin="B001J66K1M"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a86dac @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a86ca8 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a84c14 @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB0008G2FZO%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2FZO"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a84b88 @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B0008G2FZO%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2FZO"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a84ad4 @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B0008G2FZO%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2FZO"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a84a20 @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B0008G2FZO%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2FZO"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Forgetting-Remember-Kinny-Horne/dp/B0008G2FZO%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0008G2FZO", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a85790 @artist="Kinny &amp;amp; Horne", @manufacturer="Tru Thoughts", @title="Forgetting to Remember", @product_group="Music", @contained_elements=[]&gt;, @asin="B0008G2FZO"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a80bf0 @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a80aec @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7ea58 @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB000AMY0O0%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000AMY0O0"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7e9cc @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B000AMY0O0%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000AMY0O0"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7e918 @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B000AMY0O0%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000AMY0O0"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7e864 @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B000AMY0O0%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000AMY0O0"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Us-Fire-VINYL-Kinny-Horne/dp/B000AMY0O0%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000AMY0O0", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7f5d4 @artist="Kinny &amp;amp; Horne", @manufacturer="Tru Thoughts", @title="Us on Fire [12\" VINYL]", @product_group="Music", @contained_elements=[]&gt;, @asin="B000AMY0O0"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7aa34 @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7a930 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7889c @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB0008G2FZ4%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2FZ4"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a78810 @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B0008G2FZ4%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2FZ4"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7875c @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B0008G2FZ4%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2FZ4"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a786a8 @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B0008G2FZ4%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2FZ4"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Why-Me-VINYL-Kinny-Horne/dp/B0008G2FZ4%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0008G2FZ4", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a79418 @artist="Kinny &amp;amp; Horne", @manufacturer="Tru Thoughts", @title="Why Me [7\" VINYL]", @product_group="Music", @contained_elements=[]&gt;, @asin="B0008G2FZ4"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a74878 @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a74774 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a726e0 @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB001J66K1C%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1C"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a72654 @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B001J66K1C%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1C"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a725a0 @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B001J66K1C%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1C"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a724ec @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B001J66K1C%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB001J66K1C"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Enough-Said-7-VINYL-Kinny/dp/B001J66K1C%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB001J66K1C", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a7325c @artist="Kinny", @manufacturer="Tru Thoughts", @title="Enough Said [7\" VINYL]", @product_group="Music", @contained_elements=[]&gt;, @asin="B001J66K1C"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a6e6bc @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a6e5b8 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a6c524 @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB0008G2G0I%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2G0I"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a6c498 @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B0008G2G0I%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2G0I"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a6c3e4 @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B0008G2G0I%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2G0I"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a6c330 @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B0008G2G0I%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB0008G2G0I"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Forgetting-Remember-VINYL-Kinny-Horne/dp/B0008G2G0I%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0008G2G0I", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a6d0a0 @artist="Kinny &amp;amp; Horne", @manufacturer="Tru Thoughts", @title="Forgetting to Remember [VINYL]", @product_group="Music", @contained_elements=[]&gt;, @asin="B0008G2G0I"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a68500 @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a683fc @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a66368 @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB000N0LE0W%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000N0LE0W"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a662dc @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B000N0LE0W%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000N0LE0W"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a66228 @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B000N0LE0W%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000N0LE0W"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a66174 @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B000N0LE0W%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000N0LE0W"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Forgetting-Remember-Kinny-Horne/dp/B000N0LE0W%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000N0LE0W", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a66ee4 @artist="Kinny &amp;amp; Horne", @manufacturer="Tru Thoughts", @title="Forgetting to Remember", @product_group="Music", @contained_elements=[]&gt;, @asin="B000N0LE0W"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a62344 @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a62240 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a601ac @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB000CAEYEQ%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000CAEYEQ"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a60120 @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B000CAEYEQ%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000CAEYEQ"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a6006c @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B000CAEYEQ%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000CAEYEQ"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a5ffb8 @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B000CAEYEQ%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000CAEYEQ"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Rod-Kinny-EP/dp/B000CAEYEQ%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000CAEYEQ", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a60d28 @artist="Rod Kinny", @manufacturer="Import (Megaphon Importservice)", @title="The Rod Kinny EP", @product_group="Music", @contained_elements=[]&gt;, @asin="B000CAEYEQ"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a5c188 @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a5c084 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a59ff0 @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB000E9X33I%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000E9X33I"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a59f64 @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B000E9X33I%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000E9X33I"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a59eb0 @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B000E9X33I%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000E9X33I"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a59dfc @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B000E9X33I%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000E9X33I"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Us-Fire-VINYL-Kinny-Horne/dp/B000E9X33I%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000E9X33I", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a5ab6c @artist="Kinny &amp;amp; Horne", @manufacturer="Tru Thoughts", @title="Us on Fire [12\" VINYL]", @product_group="Music", @contained_elements=[]&gt;, @asin="B000E9X33I"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a55fcc @item_links=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1a55ec8 @contained_elements=[#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1af7034 @description="Add To Wishlist", @contained_elements=[], @url="http://www.amazon.co.uk/gp/registry/wishlist/add-item.html%3Fasin.0%3DB000CA74KM%26SubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000CA74KM"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1af9adc @description="Tell A Friend", @contained_elements=[], @url="http://www.amazon.co.uk/gp/pdp/taf/B000CA74KM%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000CA74KM"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1afd358 @description="All Customer Reviews", @contained_elements=[], @url="http://www.amazon.co.uk/review/product/B000CA74KM%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000CA74KM"&gt;, #&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1b00918 @description="All Offers", @contained_elements=[], @url="http://www.amazon.co.uk/gp/offer-listing/B000CA74KM%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12734%26creativeASIN%3DB000CA74KM"&gt;]&gt;, @detail_page_url="http://www.amazon.co.uk/Open-Up-the-Letter/dp/B000CA74KM%3FSubscriptionId%3D1V38YK4WRF7GKYKXBSR2%26tag%3Dwhishapo-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000CA74KM", @contained_elements=[], @item_attributes=#&lt;AmazonProductAdvertisingApi::Operations::Base::Element:0x1abe9c8 @manufacturer="Simon Kinny-Lewis", @title="Open Up the Letter", @product_group="Music", @contained_elements=[]&gt;, @asin="B000CA74KM"&gt;]&gt;
  </code></pre>
  
  <p>If I try and <code>put title</code> I get the following error:</p>
  
  <pre><code>ArgumentError at /mash
  tried to create Proc object without a block
  </code></pre>
  
  <p>Where as <code>raise title</code> seems to know what is going on:</p>
  
  <pre><code>RuntimeError at /mash
  Idle Forest of Chit Chat
  </code></pre>
  
  <p>The same thing happens if put/raise url (though obviously with the URL not the title).</p>
  
  <p>Unfortunately my Ruby knowledge is in the stage of learn as I go and I have no idea what is happening right now.  Any help would be greatly appreciated.</p>
  
  <p>(Also in case it helps, this is part of a Sinatra application...)</p>