Class: Imp
- Inherits:
-
Object
- Object
- Imp
- 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 = 5, experience = 80) ⇒ Imp
constructor
A new instance of Imp.
Constructor Details
#initialize(name = self.class, life = 80, strength = 5, experience = 80) ⇒ Imp
Returns a new instance of Imp.
49 50 51 52 53 54 |
# File 'lib/monsters.rb', line 49 def initialize(name = self.class, life = 80, strength = 5, experience = 80) @name = name @life = life @strength = strength @experience = experience end |
Instance Attribute Details
#experience ⇒ Object
Returns the value of attribute experience.
47 48 49 |
# File 'lib/monsters.rb', line 47 def experience @experience end |
#life ⇒ Object
Returns the value of attribute life.
47 48 49 |
# File 'lib/monsters.rb', line 47 def life @life end |
#name ⇒ Object
Returns the value of attribute name.
47 48 49 |
# File 'lib/monsters.rb', line 47 def name @name end |
#strength ⇒ Object
Returns the value of attribute strength.
47 48 49 |
# File 'lib/monsters.rb', line 47 def strength @strength end |