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_skillsObject

Returns the value of attribute active_skills.



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

def active_skills
  @active_skills
end

#followersObject

Returns the value of attribute followers.



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

def followers
  @followers
end

#genderObject

Returns the value of attribute gender.



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

def gender
  @gender
end

#hardcoreObject

Returns the value of attribute hardcore.



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

def hardcore
  @hardcore
end

#hero_classObject

Returns the value of attribute hero_class.



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

def hero_class
  @hero_class
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#itemsObject

Returns the value of attribute items.



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

def items
  @items
end

#last_updatedObject

Returns the value of attribute last_updated.



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

def last_updated
  @last_updated
end

#levelObject

Returns the value of attribute level.



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

def level
  @level
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#paragon_levelObject

Returns the value of attribute paragon_level.



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

def paragon_level
  @paragon_level
end

#passive_skillsObject

Returns the value of attribute passive_skills.



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

def passive_skills
  @passive_skills
end

#statsObject

Returns the value of attribute stats.



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

def stats
  @stats
end