Class: InstacartApi::SearchResult
- Inherits:
-
Object
- Object
- InstacartApi::SearchResult
- Defined in:
- lib/instacart_api/models/search_result.rb
Overview
One retailer's slice of a cross-retailer search: which store it is and the
ids of the items that matched there. Fetch full item details by passing
item_ids (with shop_id) to Client#items.
Instance Attribute Summary collapse
-
#item_ids ⇒ Object
readonly
Returns the value of attribute item_ids.
-
#retailer_id ⇒ Object
readonly
Returns the value of attribute retailer_id.
-
#shop_id ⇒ Object
readonly
Returns the value of attribute shop_id.
Instance Method Summary collapse
-
#initialize(data) ⇒ SearchResult
constructor
A new instance of SearchResult.
Constructor Details
#initialize(data) ⇒ SearchResult
Returns a new instance of SearchResult.
10 11 12 13 14 |
# File 'lib/instacart_api/models/search_result.rb', line 10 def initialize(data) @retailer_id = data["retailerId"] @shop_id = data["shopId"] @item_ids = data["itemIds"] || [] end |
Instance Attribute Details
#item_ids ⇒ Object (readonly)
Returns the value of attribute item_ids.
8 9 10 |
# File 'lib/instacart_api/models/search_result.rb', line 8 def item_ids @item_ids end |
#retailer_id ⇒ Object (readonly)
Returns the value of attribute retailer_id.
8 9 10 |
# File 'lib/instacart_api/models/search_result.rb', line 8 def retailer_id @retailer_id end |
#shop_id ⇒ Object (readonly)
Returns the value of attribute shop_id.
8 9 10 |
# File 'lib/instacart_api/models/search_result.rb', line 8 def shop_id @shop_id end |