Class: CompanionApi::Resources::Market

Inherits:
Object
  • Object
show all
Defined in:
lib/companion_api/resources/market.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(profile) ⇒ Market

Returns a new instance of Market.



6
7
8
# File 'lib/companion_api/resources/market.rb', line 6

def initialize(profile)
  @profile = profile
end

Instance Attribute Details

#profileObject

Returns the value of attribute profile.



4
5
6
# File 'lib/companion_api/resources/market.rb', line 4

def profile
  @profile
end

Instance Method Details

#item_market_listings(item_id, hq: false) ⇒ Object



10
11
12
13
14
15
# File 'lib/companion_api/resources/market.rb', line 10

def item_market_listings(item_id, hq: false)
  endpoint = "/market/items/catalog/#{item_id}"
  endpoint += "/hq" if hq

  request_result(endpoint)
end

#market_listings_by_category(category_id) ⇒ Object



17
18
19
# File 'lib/companion_api/resources/market.rb', line 17

def market_listings_by_category(category_id)
  request_result("/market/items/category/#{category_id}")
end

#transaction_history(catalog_id) ⇒ Object



21
22
23
# File 'lib/companion_api/resources/market.rb', line 21

def transaction_history(catalog_id)
  request_result("/market/items/history/catalog/#{catalog_id}")
end