Class: Gloomhaven::Character
- Inherits:
-
Object
- Object
- Gloomhaven::Character
- Defined in:
- lib/gloomhaven/character.rb
Instance Attribute Summary collapse
-
#hand_size ⇒ Object
readonly
Returns the value of attribute hand_size.
-
#health_scale ⇒ Object
readonly
Returns the value of attribute health_scale.
-
#hex_color ⇒ Object
readonly
Returns the value of attribute hex_color.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#perks ⇒ Object
readonly
Returns the value of attribute perks.
-
#spoiler_name ⇒ Object
readonly
Returns the value of attribute spoiler_name.
Instance Method Summary collapse
-
#initialize(klass) ⇒ Character
constructor
A new instance of Character.
- #to_s ⇒ Object
Constructor Details
#initialize(klass) ⇒ Character
Returns a new instance of Character.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/gloomhaven/character.rb', line 5 def initialize(klass) validate_class!(klass) @klass = klass @hand_size = data['hand_size'] @health_scale = data['health_scale'] @hex_color = data['hex_color'] @name = data['name'] @number = data['number'] @perks = data['perks'] @spoiler_name = data['spoiler_name'] || @name end |
Instance Attribute Details
#hand_size ⇒ Object (readonly)
Returns the value of attribute hand_size.
3 4 5 |
# File 'lib/gloomhaven/character.rb', line 3 def hand_size @hand_size end |
#health_scale ⇒ Object (readonly)
Returns the value of attribute health_scale.
3 4 5 |
# File 'lib/gloomhaven/character.rb', line 3 def health_scale @health_scale end |
#hex_color ⇒ Object (readonly)
Returns the value of attribute hex_color.
3 4 5 |
# File 'lib/gloomhaven/character.rb', line 3 def hex_color @hex_color end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/gloomhaven/character.rb', line 3 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'lib/gloomhaven/character.rb', line 3 def number @number end |
#perks ⇒ Object (readonly)
Returns the value of attribute perks.
3 4 5 |
# File 'lib/gloomhaven/character.rb', line 3 def perks @perks end |
#spoiler_name ⇒ Object (readonly)
Returns the value of attribute spoiler_name.
3 4 5 |
# File 'lib/gloomhaven/character.rb', line 3 def spoiler_name @spoiler_name end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/gloomhaven/character.rb', line 17 def to_s @name end |