Module: CrowdFund::FundingRound

Defined in:
lib/crowd_fund/funding_round.rb

Class Method Summary collapse

Class Method Details

.round_of_funds(project) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/crowd_fund/funding_round.rb', line 7

def self.round_of_funds(project)
  die = Die.new
  case die.roll
  when 5..6
    project.remove(125)
  when 1..2
    project.add(500)
  else
    puts "\n#{project.name} didn't receive funds this time."
  end
  pledge = PledgePool.randomize
  project.receive_pledge(pledge)
end