Class: D3api::Hero

Inherits:
BaseModel show all
Defined in:
lib/d3api/hero.rb

Constant Summary collapse

HERO_MAPPINGS =
{
  :id => 'id',
  :name => 'name',
  :hero_class => 'class',
  :level => 'level',
  :hardcore => 'hardcore',
  :paragon_level => 'paragonLevel'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Request

#get

Methods included from Connection

#connection

Constructor Details

#initialize(region, battletag_name, battletag_id, hero_id) ⇒ Hero

Returns a new instance of Hero.



17
18
19
20
21
22
23
24
# File 'lib/d3api/hero.rb', line 17

def initialize(region, battletag_name, battletag_id, hero_id)
  json_response = find(region, battletag_name, battletag_id, hero_id)

  values = super json_response

  set_method(values, HERO_MAPPINGS)
  set_hero(values)
end

Instance Attribute Details

#active_skills ⇒ Object

Returns the value of attribute active_skills.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def active_skills
  @active_skills
end

#followers ⇒ Object

Returns the value of attribute followers.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def followers
  @followers
end

#gender ⇒ Object

Returns the value of attribute gender.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def gender
  @gender
end

#hardcore ⇒ Object

Returns the value of attribute hardcore.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def hardcore
  @hardcore
end

#hero_class ⇒ Object

Returns the value of attribute hero_class.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def hero_class
  @hero_class
end

#id ⇒ Object

Returns the value of attribute id.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def id
  @id
end

#items ⇒ Object

Returns the value of attribute items.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def items
  @items
end

#last_updated ⇒ Object

Returns the value of attribute last_updated.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def last_updated
  @last_updated
end

#level ⇒ Object

Returns the value of attribute level.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def level
  @level
end

#name ⇒ Object

Returns the value of attribute name.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def name
  @name
end

#paragon_level ⇒ Object

Returns the value of attribute paragon_level.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def paragon_level
  @paragon_level
end

#passive_skills ⇒ Object

Returns the value of attribute passive_skills.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def passive_skills
  @passive_skills
end

#stats ⇒ Object

Returns the value of attribute stats.



12
13
14
# File 'lib/d3api/hero.rb', line 12

def stats
  @stats
end