Class: PAUL::Die
- Inherits:
-
Object
- Object
- PAUL::Die
- Includes:
- Auditable
- Defined in:
- lib/PAUL/exercise11game.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.
13 14 15 |
# File 'lib/PAUL/exercise11game.rb', line 13 def initialize roll end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
11 12 13 |
# File 'lib/PAUL/exercise11game.rb', line 11 def number @number end |
Instance Method Details
#roll ⇒ Object
17 18 19 20 21 |
# File 'lib/PAUL/exercise11game.rb', line 17 def roll @number = rand(1..6) audit @number end |