Class: BN::Entity::D3::Hero
Overview
A hero within Diablo 3.
Constant Summary collapse
- MAX_LEVEL =
70
Instance Method Summary collapse
-
#dead ⇒ Boolean
Get whether this hero is dead.
-
#dead= ⇒ Boolean
Set whether this hero is dead.
-
#gender ⇒ Symbol
Get the gender.
-
#gender= ⇒ Symbol
Set the gender.
-
#hardcore ⇒ Boolean
Get whether this hero is hardcore.
-
#hardcore= ⇒ Boolean
Set whether this hero is hardcore.
-
#hero_class ⇒ Symbol
Get the hero class.
-
#hero_class= ⇒ Symbol
Set the hero class.
-
#id ⇒ Integer
Get the ID.
-
#id= ⇒ Integer
Set the ID.
-
#initialize(attributes = {}) ⇒ Hero
constructor
A new instance of Hero.
-
#kills ⇒ Hash
Get the number of kills per enemy type.
-
#kills= ⇒ Hash
Set the number of kills per enemy type.
-
#last_updated ⇒ Time
Get the last updated time.
-
#last_updated= ⇒ Time
Set the last updated time.
-
#level ⇒ Integer
Get the level.
-
#level= ⇒ Integer
Set the level.
-
#name ⇒ String
Get the name.
-
#name= ⇒ String
Set the name.
-
#paragon_level ⇒ Integer
Get the paragon level.
-
#paragon_level= ⇒ Integer
Set the paragon level.
-
#seasonal ⇒ Boolean
Get whether this hero is seasonal.
-
#seasonal= ⇒ Boolean
Set whether this hero is seasonal.
Methods included from Helpers::HasAttributes
Constructor Details
#initialize(attributes = {}) ⇒ Hero
Returns a new instance of Hero.
10 11 12 13 14 15 16 17 18 |
# File 'lib/bn/entity/d3/hero.rb', line 10 def initialize(attributes={}) super @level ||= 1 @paragon_level ||= 0 @hardcore ||= false @seasonal ||= false @dead ||= false end |
Instance Method Details
#dead ⇒ Boolean
Get whether this hero is dead.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 140
|
#dead= ⇒ Boolean
Set whether this hero is dead.
150 |
# File 'lib/bn/entity/d3/hero.rb', line 150 attribute(:dead) { |value| !!value } |
#gender ⇒ Symbol
Get the gender.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 56
|
#gender= ⇒ Symbol
Set the gender.
66 |
# File 'lib/bn/entity/d3/hero.rb', line 66 attribute(:gender) { |value| value.to_sym } |
#hardcore ⇒ Boolean
Get whether this hero is hardcore.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 104
|
#hardcore= ⇒ Boolean
Set whether this hero is hardcore.
114 |
# File 'lib/bn/entity/d3/hero.rb', line 114 attribute(:hardcore) { |value| !!value } |
#hero_class ⇒ Symbol
Get the hero class.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 44
|
#hero_class= ⇒ Symbol
Set the hero class.
54 |
# File 'lib/bn/entity/d3/hero.rb', line 54 attribute(:hero_class) { |value| value.to_sym } |
#id ⇒ Integer
Get the ID.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 20
|
#id= ⇒ Integer
Set the ID.
30 |
# File 'lib/bn/entity/d3/hero.rb', line 30 attribute(:id) { |value| value.to_i } |
#kills ⇒ Hash
Get the number of kills per enemy type.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 92
|
#kills= ⇒ Hash
Set the number of kills per enemy type.
102 |
# File 'lib/bn/entity/d3/hero.rb', line 102 attribute(:kills) { |value| value.to_h } |
#last_updated ⇒ Time
Get the last updated time.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 128
|
#last_updated= ⇒ Time
Set the last updated time.
138 |
# File 'lib/bn/entity/d3/hero.rb', line 138 attribute(:last_updated) { |value| convert_time(value) } |
#level ⇒ Integer
Get the level.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 68
|
#level= ⇒ Integer
Set the level.
78 |
# File 'lib/bn/entity/d3/hero.rb', line 78 attribute(:level) { |value| validate_level(value) } |
#name ⇒ String
Get the name.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 32
|
#name= ⇒ String
Set the name.
42 |
# File 'lib/bn/entity/d3/hero.rb', line 42 attribute(:name) { |value| value.to_s.strip } |
#paragon_level ⇒ Integer
Get the paragon level.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 80
|
#paragon_level= ⇒ Integer
Set the paragon level.
90 |
# File 'lib/bn/entity/d3/hero.rb', line 90 attribute(:paragon_level) { |value| validate_level(value, true) } |
#seasonal ⇒ Boolean
Get whether this hero is seasonal.
|
|
# File 'lib/bn/entity/d3/hero.rb', line 116
|
#seasonal= ⇒ Boolean
Set whether this hero is seasonal.
126 |
# File 'lib/bn/entity/d3/hero.rb', line 126 attribute(:seasonal) { |value| !!value } |