Class: Human
- Inherits:
-
Object
- Object
- Human
- Defined in:
- lib/monsters.rb
Instance Attribute Summary collapse
-
#experience ⇒ Object
Returns the value of attribute experience.
-
#life ⇒ Object
Returns the value of attribute life.
-
#name ⇒ Object
Returns the value of attribute name.
-
#strength ⇒ Object
Returns the value of attribute strength.
Instance Method Summary collapse
-
#initialize(name = self.class, life = 70, strength = 4, experience = 30) ⇒ Human
constructor
A new instance of Human.
Constructor Details
#initialize(name = self.class, life = 70, strength = 4, experience = 30) ⇒ Human
Returns a new instance of Human.
15 16 17 18 19 20 |
# File 'lib/monsters.rb', line 15 def initialize(name = self.class, life = 70, strength = 4, experience = 30) @name = name @life = life @strength = strength @experience = experience end |
Instance Attribute Details
#experience ⇒ Object
Returns the value of attribute experience.
13 14 15 |
# File 'lib/monsters.rb', line 13 def experience @experience end |
#life ⇒ Object
Returns the value of attribute life.
13 14 15 |
# File 'lib/monsters.rb', line 13 def life @life end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/monsters.rb', line 13 def name @name end |
#strength ⇒ Object
Returns the value of attribute strength.
13 14 15 |
# File 'lib/monsters.rb', line 13 def strength @strength end |