lib/yummly/search_result.rb in yummly-0.0.12 vs lib/yummly/search_result.rb in yummly-0.0.13

- old
+ new

@@ -5,14 +5,14 @@ module Yummly class SearchResult include Enumerable - attr_accessor :response, :params, :max_result, :start + attr_accessor :json, :params, :max_result, :start - def initialize(response) - @response = response + def initialize(json) + @json = json end def each(&block) recipes.each(&block) end @@ -20,23 +20,23 @@ def recipes @recipes ||= matches.collect { |recipe_json| Yummly::Recipe.new(recipe_json) } end def matches - response["matches"] || [] + json["matches"] || [] end def total_match_count - response["totalMatchCount"] + json["totalMatchCount"] end alias_method :total, :total_match_count def attribution - Yummly::Attribution.new(response["attribution"]) + Yummly::Attribution.new(json["attribution"]) end def criteria - response["criteria"] + json["criteria"] end end end \ No newline at end of file