Class: Troll

Inherits:
Object
  • Object
show all
Defined in:
lib/monsters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#experienceObject

Returns the value of attribute experience.



69
70
71
# File 'lib/monsters.rb', line 69

def experience
  @experience
end

#lifeObject

Returns the value of attribute life.



69
70
71
# File 'lib/monsters.rb', line 69

def life
  @life
end

#nameObject

Returns the value of attribute name.



69
70
71
# File 'lib/monsters.rb', line 69

def name
  @name
end

#strengthObject

Returns the value of attribute strength.



69
70
71
# File 'lib/monsters.rb', line 69

def strength
  @strength
end