Class: Songfile::Die

Inherits:
Object
  • Object
show all
Defined in:
lib/crowdfund/die.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDie

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

#numberObject (readonly)

Returns the value of attribute number.



16
17
18
# File 'lib/crowdfund/die.rb', line 16

def number
  @number
end

Instance Method Details

#rollObject



18
19
20
# File 'lib/crowdfund/die.rb', line 18

def roll
    @number = rand(1..6)
end