Class: OpenDotaApi::Entity

Inherits:
Object
  • Object
show all
Includes:
Hashable, OpenDotaApi::Entities::Instantiatable
Defined in:
lib/open_dota_api/entity.rb

Direct Known Subclasses

Explorer, Hero, League, Match, Matches::Player, Player, ProPlayer, Team

Class Method Summary collapse

Instance Method Summary collapse

Methods included from OpenDotaApi::Entities::Instantiatable

included

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