Class: InstacartApi::SearchResult

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_idsObject (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_idObject (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_idObject (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