Class: CoopAl::Monster

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

Overview

Monster

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, xp, loot, encounter) ⇒ Monster

Returns a new instance of Monster.



8
9
10
11
12
13
# File 'lib/coop_al/monster.rb', line 8

def initialize(id, xp, loot, encounter)
  @id = id
  @xp = xp
  @loot = loot
  @encounter = encounter
end

Instance Attribute Details

#encounterObject (readonly)

Returns the value of attribute encounter.



6
7
8
# File 'lib/coop_al/monster.rb', line 6

def encounter
  @encounter
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/coop_al/monster.rb', line 6

def id
  @id
end

#lootObject (readonly)

Returns the value of attribute loot.



6
7
8
# File 'lib/coop_al/monster.rb', line 6

def loot
  @loot
end

#xpObject (readonly)

Returns the value of attribute xp.



6
7
8
# File 'lib/coop_al/monster.rb', line 6

def xp
  @xp
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/coop_al/monster.rb', line 15

def to_s
  @id.to_s
end