:books: :package: Amazon Simple INterface - Support for ItemLookup, SimilarityLookup, Search, BrowseNode and Cart Operations
167
stars
59
forks
source link
NoMethodError: undefined method `each_pair' error when searching for an ISBN #7
Closed
rounders closed 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