Class: StudioGame::Die

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Auditable

#audit

Instance Attribute Details

#numberObject (readonly)

makes die remember the number it rolled



5
6
7
# File 'lib/die.rb', line 5

def number
  @number
end

Instance Method Details

#rollObject



7
8
9
10
11
# File 'lib/die.rb', line 7

def roll
    @number = rand(1..6)
    audit
    @number #Lastly, return the @number value as the last expression in the method since the game expects roll to return a number.

end