module CrowdFund::Fundable

Public Instance Methods

<=>(other) click to toggle source
# File lib/crowd_fund/fundable.rb, line 8
def <=>(other)
  other.total_to_fund <=> total_to_fund
end
add(amount_to_add) click to toggle source
# File lib/crowd_fund/fundable.rb, line 3
def add(amount_to_add)
  self.amount += amount_to_add
  puts "\n#{name} got more funds."
end
full?() click to toggle source
# File lib/crowd_fund/fundable.rb, line 21
def full?
  total_to_fund <= 0
end
remove(amount_to_remove) click to toggle source
# File lib/crowd_fund/fundable.rb, line 12
def remove(amount_to_remove)
  self.amount -= amount_to_remove
  puts "\n#{name} lost some funds."
end
stats() click to toggle source
# File lib/crowd_fund/fundable.rb, line 17
def stats
  full? ? "Full!" : "Is under funded yet"
end
total_to_fund() click to toggle source
# File lib/crowd_fund/fundable.rb, line 25
def total_to_fund
  self.target - self.amount
end