Module: Crowdfund::Fundable

Included in:
Project
Defined in:
lib/crowdfund/fundable.rb

Instance Method Summary collapse

Instance Method Details

#add_funds(amount = 25) ⇒ Object



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

def add_funds(amount=25)
  self.funding += amount
  puts "#{name} gained some funds!"
end

#fully_funded?Boolean

Returns:

  • (Boolean)


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

def fully_funded?
  funds_needed <= 0
end

#funds_neededObject



14
15
16
# File 'lib/crowdfund/fundable.rb', line 14

def funds_needed
  goal - funding
end

#lose_funds(amount = 15) ⇒ Object



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

def lose_funds(amount=15)
  self.funding -= amount
  puts "#{name} lost some funds!"
end