Class: Stat

Inherits:
Object
  • Object
show all
Defined in:
lib/sightstone/stat.rb

Direct Known Subclasses

ChampionStat

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Stat

Returns a new instance of Stat.



4
5
6
7
8
9
10
11
12
# File 'lib/sightstone/stat.rb', line 4

def initialize(data)
  @id = data['id']
  @name = data['name']
  @value = if data.has_key? 'value'
    data['value']
  else
    data['count']
  end
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/sightstone/stat.rb', line 2

def id
  @id
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/sightstone/stat.rb', line 2

def name
  @name
end

#valueObject

Returns the value of attribute value.



2
3
4
# File 'lib/sightstone/stat.rb', line 2

def value
  @value
end