Class: OpenDotaApi::Entity
- Inherits:
-
Object
- Object
- OpenDotaApi::Entity
- Includes:
- Hashable, OpenDotaApi::Entities::Instantiatable
- Defined in:
- lib/open_dota_api/entity.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Entity
constructor
A new instance of Entity.
Methods included from OpenDotaApi::Entities::Instantiatable
Constructor Details
#initialize(data) ⇒ Entity
Returns a new instance of Entity.
15 16 17 |
# File 'lib/open_dota_api/entity.rb', line 15 def initialize(data) @data = data end |
Class Method Details
.define_adder(attributes) ⇒ Object
9 10 11 12 13 |
# File 'lib/open_dota_api/entity.rb', line 9 def self.define_adder(attributes) attributes.each do |attribute| define_method(attribute) { data[attribute] } end end |