Class: CrowdFund::Community
- Inherits:
-
Object
- Object
- CrowdFund::Community
- Defined in:
- lib/crowdfund/startups.rb
Instance Method Summary collapse
- #add_project(project) ⇒ Object
-
#initialize(name) ⇒ Community
constructor
A new instance of Community.
- #request_funding ⇒ Object
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_funding ⇒ Object
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 |