Class: SteamCondenser::Community::GameStatsDatum

Inherits:
Object
  • Object
show all
Defined in:
lib/steam-condenser/community/game_stats_datum.rb

Defined Under Namespace

Classes: Instance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema, data) ⇒ GameStatsDatum

Returns a new instance of GameStatsDatum

Parameters:


20
21
22
23
24
25
# File 'lib/steam-condenser/community/game_stats_datum.rb', line 20

def initialize(schema, data)
  @api_name      = data[:name]
  @default_value = data[:defaultvalue]
  @schema        = schema
  @name          = data[:displayName]
end

Instance Attribute Details

#api_nameObject (readonly)

Returns the value of attribute api_name


12
13
14
# File 'lib/steam-condenser/community/game_stats_datum.rb', line 12

def api_name
  @api_name
end

#default_valueObject (readonly)

Returns the value of attribute default_value


14
15
16
# File 'lib/steam-condenser/community/game_stats_datum.rb', line 14

def default_value
  @default_value
end

#schemaObject (readonly)

Returns the value of attribute schema


16
17
18
# File 'lib/steam-condenser/community/game_stats_datum.rb', line 16

def schema
  @schema
end

Instance Method Details

#inspectObject


27
28
29
# File 'lib/steam-condenser/community/game_stats_datum.rb', line 27

def inspect
  "#<#{self.class}: #@api_name (#@default_value)>"
end

#instance(user, value) ⇒ Object


31
32
33
# File 'lib/steam-condenser/community/game_stats_datum.rb', line 31

def instance(user, value)
  Instance.new user, self, value
end

#name(language = GameStatsSchema.default_language) ⇒ Object


35
36
37
# File 'lib/steam-condenser/community/game_stats_datum.rb', line 35

def name(language = GameStatsSchema.default_language)
  @schema.datum_names(language)[@api_name]
end