Class: Troll
- Inherits:
-
Object
- Object
- Troll
- 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 = 100, strength = 8, experience = 100) ⇒ Troll
constructor
A new instance of Troll.
Constructor Details
#initialize(name = self.class, life = 100, strength = 8, experience = 100) ⇒ Troll
Returns a new instance of Troll.
71 72 73 74 75 76 |
# File 'lib/monsters.rb', line 71 def initialize(name = self.class, life = 100, strength = 8, experience = 100) @name = name @life = life @strength = strength @experience = experience end |
Instance Attribute Details
#experience ⇒ Object
Returns the value of attribute experience.
69 70 71 |
# File 'lib/monsters.rb', line 69 def experience @experience end |
#life ⇒ Object
Returns the value of attribute life.
69 70 71 |
# File 'lib/monsters.rb', line 69 def life @life end |
#name ⇒ Object
Returns the value of attribute name.
69 70 71 |
# File 'lib/monsters.rb', line 69 def name @name end |
#strength ⇒ Object
Returns the value of attribute strength.
69 70 71 |
# File 'lib/monsters.rb', line 69 def strength @strength end |