Class: LoLBase::RankedStats
- Inherits:
-
Object
- Object
- LoLBase::RankedStats
- Defined in:
- lib/lolbase/data/stats.rb
Defined Under Namespace
Classes: Champion
Instance Attribute Summary collapse
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#overall ⇒ Object
readonly
Returns the value of attribute overall.
Instance Method Summary collapse
- #all ⇒ Object
- #find(criteria = {}) ⇒ Object
-
#initialize(data) ⇒ RankedStats
constructor
A new instance of RankedStats.
- #raw_json ⇒ Object
Constructor Details
#initialize(data) ⇒ RankedStats
Returns a new instance of RankedStats.
94 95 96 97 98 |
# File 'lib/lolbase/data/stats.rb', line 94 def initialize(data) @data = data parse data self end |
Instance Attribute Details
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified.
83 84 85 |
# File 'lib/lolbase/data/stats.rb', line 83 def last_modified @last_modified end |
#overall ⇒ Object (readonly)
Returns the value of attribute overall.
83 84 85 |
# File 'lib/lolbase/data/stats.rb', line 83 def overall @overall end |
Instance Method Details
#all ⇒ Object
111 112 113 |
# File 'lib/lolbase/data/stats.rb', line 111 def all return @parsed_data end |
#find(criteria = {}) ⇒ Object
104 105 106 107 108 109 |
# File 'lib/lolbase/data/stats.rb', line 104 def find(criteria = {}) if criteria[:champion_id] return @parsed_data.select { |item| item.id == criteria[:champion_id] }.first end nil end |
#raw_json ⇒ Object
100 101 102 |
# File 'lib/lolbase/data/stats.rb', line 100 def raw_json @data end |