Class: CrowdFund::Community

Inherits:
Object
  • Object
show all
Defined in:
lib/crowdfund/startups.rb

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Community

Returns a new instance of Community.



32
33
34
35
# File 'lib/crowdfund/startups.rb', line 32

def initialize(name)
    @name = name.upcase
    @projects = []  
end

Instance Method Details

#add_project(project) ⇒ Object



37
38
39
# File 'lib/crowdfund/startups.rb', line 37

def add_project(project)
    @projects << project
end

#request_fundingObject



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/crowdfund/startups.rb', line 41

def request_funding
    puts "The current projects are :"
    @projects.each do |project|
    puts project
    end
    @projects.each do |project|
    project.lost
    project.gained
    puts project
    end
    
end