Module: CrowdFund::Fundable
- Included in:
- Project
- Defined in:
- lib/crowdfund/fundable.rb
Instance Method Summary collapse
- #add_fund(amount = 25) ⇒ Object
- #fully_funded? ⇒ Boolean
- #funding_needed ⇒ Object
- #remove_fund(amount = 15) ⇒ Object
Instance Method Details
#add_fund(amount = 25) ⇒ Object
3 4 5 6 |
# File 'lib/crowdfund/fundable.rb', line 3 def add_fund(amount=25) self.funding += amount puts "\n#{name} got more funds!" end |
#fully_funded? ⇒ Boolean
17 18 19 |
# File 'lib/crowdfund/fundable.rb', line 17 def fully_funded? funding_needed <= 0 end |
#funding_needed ⇒ Object
13 14 15 |
# File 'lib/crowdfund/fundable.rb', line 13 def funding_needed target_funding - funding end |
#remove_fund(amount = 15) ⇒ Object
8 9 10 11 |
# File 'lib/crowdfund/fundable.rb', line 8 def remove_fund(amount=15) self.funding -= amount puts "\n#{name} lost some funds!" end |