Class: CrowdFund::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.



6
7
8
# File 'lib/crowdfund/die.rb', line 6

def initialize
    roll
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



4
5
6
# File 'lib/crowdfund/die.rb', line 4

def number
  @number
end

Instance Method Details

#rollObject



10
11
12
# File 'lib/crowdfund/die.rb', line 10

def roll
    rand(1..6)
end