Class: Orc
- Inherits:
-
Object
- Object
- Orc
- 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 = 80, strength = 6, experience = 100) ⇒ Orc
constructor
A new instance of Orc.
Constructor Details
#initialize(name = self.class, life = 80, strength = 6, experience = 100) ⇒ Orc
Returns a new instance of Orc.
60 61 62 63 64 65 |
# File 'lib/monsters.rb', line 60 def initialize(name = self.class, life = 80, strength = 6, experience = 100) @name = name @life = life @strength = strength @experience = experience end |
Instance Attribute Details
#experience ⇒ Object
Returns the value of attribute experience.
58 59 60 |
# File 'lib/monsters.rb', line 58 def experience @experience end |
#life ⇒ Object
Returns the value of attribute life.
58 59 60 |
# File 'lib/monsters.rb', line 58 def life @life end |
#name ⇒ Object
Returns the value of attribute name.
58 59 60 |
# File 'lib/monsters.rb', line 58 def name @name end |
#strength ⇒ Object
Returns the value of attribute strength.
58 59 60 |
# File 'lib/monsters.rb', line 58 def strength @strength end |