Class: PAUL::Die

Inherits:
Object
  • Object
show all
Includes:
Auditable
Defined in:
lib/PAUL/exercise11game.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Auditable

#audit

Constructor Details

#initializeDie

Returns a new instance of Die.



13
14
15
# File 'lib/PAUL/exercise11game.rb', line 13

def initialize
    roll
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



11
12
13
# File 'lib/PAUL/exercise11game.rb', line 11

def number
  @number
end

Instance Method Details

#rollObject



17
18
19
20
21
# File 'lib/PAUL/exercise11game.rb', line 17

def roll
    @number = rand(1..6)
    audit
    @number
end