Module: Crowdfund::Fundable
- Included in:
- Project
- Defined in:
- lib/crowdfund/fundable.rb
Instance Method Summary collapse
- #add_funds(amount = 25) ⇒ Object
- #fully_funded? ⇒ Boolean
- #funds_needed ⇒ Object
- #lose_funds(amount = 15) ⇒ Object
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
18 19 20 |
# File 'lib/crowdfund/fundable.rb', line 18 def fully_funded? funds_needed <= 0 end |
#funds_needed ⇒ Object
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 |