Class: FullTime::Employment

Inherits:
Object
  • Object
show all
Defined in:
lib/full_time/employment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEmployment

Returns a new instance of Employment.



5
6
7
# File 'lib/full_time/employment.rb', line 5

def initialize
  @companies = []
end

Instance Attribute Details

#companiesObject

Returns the value of attribute companies.



3
4
5
# File 'lib/full_time/employment.rb', line 3

def companies
  @companies
end

Instance Method Details

#company(name = nil, &block) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/full_time/employment.rb', line 9

def company(name = nil, &block)
  if block_given?
    company = Company.new
    company.name = name
    company.instance_eval(&block)
    @companies << company
    company
  end
end