Class: FullTime::Company
- Inherits:
-
Object
- Object
- FullTime::Company
- Extended by:
- DSL
- Defined in:
- lib/full_time/company.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#projects ⇒ Object
Returns the value of attribute projects.
Instance Method Summary collapse
-
#initialize ⇒ Company
constructor
A new instance of Company.
- #project(name = nil, start_date: nil, end_date: nil, &block) ⇒ Object
Methods included from DSL
Constructor Details
#initialize ⇒ Company
Returns a new instance of Company.
9 10 11 |
# File 'lib/full_time/company.rb', line 9 def initialize @projects = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/full_time/company.rb', line 7 def name @name end |
#projects ⇒ Object
Returns the value of attribute projects.
7 8 9 |
# File 'lib/full_time/company.rb', line 7 def projects @projects end |
Instance Method Details
#project(name = nil, start_date: nil, end_date: nil, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/full_time/company.rb', line 13 def project(name = nil, start_date: nil, end_date: nil, &block) if block_given? project = Project.new project.name = name project.start_date = start_date project.end_date = end_date project.instance_eval(&block) @projects << project project end end |