module Fundable
Public Instance Methods
<=>(other_funding)
click to toggle source
# File lib/crowd_fund/fundable.rb, line 21 def <=> (other_funding) other_funding.name <=> name end
add_funds()
click to toggle source
# File lib/crowd_fund/fundable.rb, line 12 def add_funds self.funding += 25 puts "#{name} got more funds!" end
fully_funded?()
click to toggle source
# File lib/crowd_fund/fundable.rb, line 25 def fully_funded? total_funding_outstanding <= 0 end
remove_funds()
click to toggle source
# File lib/crowd_fund/fundable.rb, line 7 def remove_funds self.funding -= 15 puts "#{name} lost some funds!" end
status()
click to toggle source
# File lib/crowd_fund/fundable.rb, line 29 def status fully_funded? ? "Fully_funded" : "Under_funded" end
total_funding_outstanding()
click to toggle source
# File lib/crowd_fund/fundable.rb, line 17 def total_funding_outstanding self.target - self.funding end
total_funds()
click to toggle source
# File lib/crowd_fund/fundable.rb, line 3 def total_funds self.funding + pledges end