Class: Employer::Workshop

Inherits:
Object
  • Object
show all
Defined in:
lib/employer/workshop.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.pipeline(filename) ⇒ Object



12
13
14
15
# File 'lib/employer/workshop.rb', line 12

def self.pipeline(filename)
  workshop = setup(File.read(filename), true)
  workshop.pipeline
end

.setup(config_code, skip_employees = false) ⇒ Object



5
6
7
8
9
10
# File 'lib/employer/workshop.rb', line 5

def self.setup(config_code, skip_employees = false)
  boss = Employer::Boss.new
  pipeline = Employer::Pipeline.new
  boss.pipeline = pipeline
  workshop = new(boss, config_code, skip_employees)
end

Instance Method Details

#pipelineObject



30
31
32
# File 'lib/employer/workshop.rb', line 30

def pipeline
  @boss.pipeline
end

#runObject



17
18
19
# File 'lib/employer/workshop.rb', line 17

def run
  @boss.manage
end

#stopObject



21
22
23
# File 'lib/employer/workshop.rb', line 21

def stop
  @boss.stop_managing
end

#stop_nowObject



25
26
27
28
# File 'lib/employer/workshop.rb', line 25

def stop_now
  @boss.stop_managing
  @boss.stop_employees
end