Class: StudioGame::Die
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
makes die remember the number it rolled.
Instance Method Summary collapse
Methods included from Auditable
Instance Attribute Details
#number ⇒ Object (readonly)
makes die remember the number it rolled
5 6 7 |
# File 'lib/die.rb', line 5 def number @number end |
Instance Method Details
#roll ⇒ Object
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 |