lib/ebay/finding/api/response.rb in ebay-finding-api-0.1.0 vs lib/ebay/finding/api/response.rb in ebay-finding-api-0.1.1

- old
+ new

@@ -8,10 +8,14 @@ end def items return [] unless success? - @items ||= JSON.parse(@response.body)["#{@key_name}Response"].first["searchResult"] + result = JSON.parse(@response.body)["#{@key_name}Response"].first["searchResult"].first + + return [] if result["@count"] === "0" + + @items ||= result["item"] end def success? @response.success? end