Class: StudioGame::Die
- Inherits:
-
Object
- Object
- StudioGame::Die
- Includes:
- Auditable
- Defined in:
- lib/studio_game/die.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize ⇒ Die
constructor
A new instance of Die.
- #roll ⇒ Object
Methods included from Auditable
Constructor Details
#initialize ⇒ Die
Returns a new instance of Die.
9 10 11 |
# File 'lib/studio_game/die.rb', line 9 def initialize roll end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
7 8 9 |
# File 'lib/studio_game/die.rb', line 7 def number @number end |
Instance Method Details
#roll ⇒ Object
13 14 15 16 17 |
# File 'lib/studio_game/die.rb', line 13 def roll @number = rand(1..6) audit @number end |