Module: Steam::Economy
- Defined in:
- lib/steam-api/steam/economy.rb
Overview
A Ruby DSL for communicating with the Steam Web API.
Class Method Summary collapse
-
.asset_info(appid, params: {}) ⇒ Hash
Get Asset Class Info.
-
.asset_prices(appid, language: nil, currency: nil) ⇒ Hash
Get Asset Prices.
- .client ⇒ Object
- .parse_response(response) ⇒ Object
Class Method Details
.asset_info(appid, params: {}) ⇒ Hash
Get Asset Class Info
22 23 24 25 26 |
# File 'lib/steam-api/steam/economy.rb', line 22 def self.asset_info(appid, params: {}) params[:appid] = appid response = client.get 'GetAssetClassInfo/v1', params: params parse_response(response) end |
.asset_prices(appid, language: nil, currency: nil) ⇒ Hash
Get Asset Prices
40 41 42 43 44 45 46 47 |
# File 'lib/steam-api/steam/economy.rb', line 40 def self.asset_prices(appid, language: nil, currency: nil) params = { appid: appid } params[:language] = language unless language.nil? params[:currency] = currency unless currency.nil? response = client.get 'GetAssetPrices/v1', params: params parse_response(response) end |
.client ⇒ Object
49 50 51 |
# File 'lib/steam-api/steam/economy.rb', line 49 def self.client build_client 'ISteamEconomy' end |
.parse_response(response) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/steam-api/steam/economy.rb', line 53 def self.parse_response(response) response = response.parse_key('result') response.check_success response.delete('success') response end |