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

Class Method Details

.asset_info(appid, params: {}) ⇒ Hash

Get Asset Class Info

Parameters:

  • appid (String)

    The application ID for the Steam Game.

  • params (Hash) (defaults to: {})

    Parameters to pass to the API

Options Hash (params:):

  • :class_count (Fixnum)

    The number of classids passed to the request.

  • :classidN (Fixnum)

    Where N can be a series of sequential numbers to form a list of class IDs. [1] [2]

  • :instanceidN (Fixnum)

    Instance ID of the nth class. (Optional)

  • :language (String)

    The ISO639-1 language code for the language all localized strings should be returned in. Not all strings have been translated to every language. If a language does not have a string, the English string will be returned instead. If this parameter is omitted the string token will be returned for the strings. (Optional)

Returns:

  • (Hash)

    A hash containing the API response

See Also:

Since:

  • 1.0.0



19
20
21
22
23
24
# File 'lib/steam-api/steam/economy.rb', line 19

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

Parameters:

  • appid (String)

    The application ID for the Steam Game.

  • language (String) (defaults to: nil)

    The ISO639-1 language code for the language all localized strings should be returned in. Not all strings have been translated to every language. If a language does not have a string, the English string will be returned instead. If this parameter is omitted the string token will be returned for the strings. (Optional)

  • currency (String) (defaults to: nil)

    The ISO 4217 code for currency specific filtering. (Optional)

Returns:

  • (Hash)

    A hash containing the API response

See Also:

Since:

  • 1.0.0



35
36
37
38
39
40
41
42
# File 'lib/steam-api/steam/economy.rb', line 35

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