phoet / asin

:books: :package: Amazon Simple INterface - Support for ItemLookup, SimilarityLookup, Search, BrowseNode and Cart Operations
http://asin.herokuapp.com/
167 stars 59 forks source link

NoMethodError: undefined method `each_pair' error when searching for an ISBN #7

Closed rounders closed 13 years ago

rounders commented 13 years ago

When doing a search_keywords for an ISBN number (e.g. for 0471317519) I receive the following error:

NoMethodError: undefined method `each_pair' for ["ASIN", "0471317519"]:Array

After a bit of investigation here is what I've found:

when TotalResults > 1 then response['ItemSearchResponse']['Items'] is a an array of hashes

when totalResults == 1 then response['ItemSearchResponse']['Items'] is a single hash

phoet commented 13 years ago

pushed a new version https://rubygems.org/gems/asin/versions/0.5.1

rounders commented 13 years ago

thanks :-)