Class: WalmartOpen::SearchResults
- Inherits:
-
Object
- Object
- WalmartOpen::SearchResults
- Defined in:
- lib/walmart_open/search_results.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(response) ⇒ SearchResults
constructor
A new instance of SearchResults.
Constructor Details
#initialize(response) ⇒ SearchResults
Returns a new instance of SearchResults.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/walmart_open/search_results.rb', line 11 def initialize(response) @query = response["query"] @total = response["totalResults"] @start = response["start"] # TODO: set the page! # @page = ... @items = [] response["items"].each do |item| @items << Item.new(item) end end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
5 6 7 |
# File 'lib/walmart_open/search_results.rb', line 5 def items @items end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
5 6 7 |
# File 'lib/walmart_open/search_results.rb', line 5 def page @page end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
5 6 7 |
# File 'lib/walmart_open/search_results.rb', line 5 def query @query end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
5 6 7 |
# File 'lib/walmart_open/search_results.rb', line 5 def start @start end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
5 6 7 |
# File 'lib/walmart_open/search_results.rb', line 5 def total @total end |