Class: Wot::Player::ExtendedStatistics
- Inherits:
-
Object
- Object
- Wot::Player::ExtendedStatistics
- Defined in:
- lib/wot/player/extended_statistics.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ ExtendedStatistics
constructor
A new instance of ExtendedStatistics.
Constructor Details
#initialize(data) ⇒ ExtendedStatistics
Returns a new instance of ExtendedStatistics.
7 8 9 10 11 12 |
# File 'lib/wot/player/extended_statistics.rb', line 7 def initialize(data) @data = data @data.each do |key,_| self.send key end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object (private)
16 17 18 19 20 21 22 |
# File 'lib/wot/player/extended_statistics.rb', line 16 def method_missing(method_name, *args, &block) self.class.instance_eval do define_method method_name do return @data[method_name] end end end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/wot/player/extended_statistics.rb', line 5 def data @data end |