Class: Songfile::Die
- Inherits:
-
Object
- Object
- Songfile::Die
- Defined in:
- lib/crowdfund/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
Constructor Details
#initialize ⇒ Die
Returns a new instance of Die.
22 23 24 |
# File 'lib/crowdfund/die.rb', line 22 def initialize roll #the new die object now initializes as soon as "roll" is called anywhere. end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
16 17 18 |
# File 'lib/crowdfund/die.rb', line 16 def number @number end |
Instance Method Details
#roll ⇒ Object
18 19 20 |
# File 'lib/crowdfund/die.rb', line 18 def roll @number = rand(1..6) end |