Class: CrowdFund::Die
- Inherits:
-
Object
- Object
- CrowdFund::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.
5 6 7 |
# File 'lib/crowdfund/die.rb', line 5 def initialize roll end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'lib/crowdfund/die.rb', line 3 def number @number end |
Instance Method Details
#roll ⇒ Object
9 10 11 |
# File 'lib/crowdfund/die.rb', line 9 def roll @number = rand(1..6) end |