Class: SteamMist::Schema
- Inherits:
-
Object
- Object
- SteamMist::Schema
- Defined in:
- lib/steam_mist/schema.rb
Overview
TODO:
More tests.
Handles the Schema for games.
Instance Method Summary collapse
-
#data ⇒ Hashie::Mash
Retrieves the data from the request.
-
#initialize(key, app_id, lang = nil) ⇒ Schema
constructor
Initialize the schema.
-
#items ⇒ SortedSet<Item>
Returns a list of items in the schema.
Constructor Details
#initialize(key, app_id, lang = nil) ⇒ Schema
Initialize the schema. The first argument is the application id, which valve uses internally to distinguish games from each other.
17 18 19 20 21 22 23 24 25 |
# File 'lib/steam_mist/schema.rb', line 17 def initialize(key, app_id, lang = nil) @app_id = app_id @session = Session.new @get_schema = @session.get_interface("IEconItems_#{app_id}").get_schema if lang @get_schema.with_arguments!(:language => lang) end end |
Instance Method Details
#data ⇒ Hashie::Mash
Retrieves the data from the request.
37 38 39 |
# File 'lib/steam_mist/schema.rb', line 37 def data @_data ||= Hashie::Mash.new(@get_schema.get.data["result"]) end |
#items ⇒ SortedSet<Item>
Returns a list of items in the schema.
30 31 32 |
# File 'lib/steam_mist/schema.rb', line 30 def items @_items ||= data.items end |