Class: CrowdFund::SecureProject
- Defined in:
- lib/crowd_fund/secure_project.rb
Instance Attribute Summary
Attributes inherited from Project
Instance Method Summary collapse
Methods inherited from Project
#each_pledge_received, #initialize, #receive_pledge, #total_pledges
Methods included from Printable
Methods included from Fundable
#<=>, #full?, #remove, #stats, #total_to_fund
Constructor Details
This class inherits a constructor from CrowdFund::Project
Instance Method Details
#add(amount_to_add) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/crowd_fund/secure_project.rb', line 10 def add(amount_to_add) if halfway? super(total_to_fund) puts "\n#{@name} has received a matching fund." else super(amount_to_add) end end |
#halfway? ⇒ Boolean
6 7 8 |
# File 'lib/crowd_fund/secure_project.rb', line 6 def halfway? @amount == target / 2 end |