class CrowdFund::MatchingProject

Public Class Methods

new(name, target, funding=0) click to toggle source
Calls superclass method
# File lib/crowdfund/matching_project.rb, line 5
def initialize(name, target, funding=0)
  super(name, target, funding)
  @halfway_funded = target / 2
end

Public Instance Methods

add_funds() click to toggle source
Calls superclass method
# File lib/crowdfund/matching_project.rb, line 14
def add_funds
  if halfway_funded?
    @funding += (25*2)
    puts "#{@name} has received at least half its funding!" if halfway_funded?
  else
    super
  end
end
halfway_funded?() click to toggle source
# File lib/crowdfund/matching_project.rb, line 10
def halfway_funded?
  @halfway_funded <= funding
end