Class: WIP::Runner::Workflow::Builder::Task

Inherits:
Component
  • Object
show all
Defined in:
lib/wip/runner/workflow/builder/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#method_missing, #prologue, #respond_to_missing?, #shell, #shells

Constructor Details

#initialize(command, heading, &block) ⇒ Task

Returns a new instance of Task.



7
8
9
10
11
12
# File 'lib/wip/runner/workflow/builder/task.rb', line 7

def initialize(command, heading, &block)
  @command = command
  @heading = heading
  @steps   = []
  instance_exec(&block) if block_given?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class WIP::Runner::Workflow::Builder::Component

Instance Attribute Details

#headingObject (readonly)

Returns the value of attribute heading.



5
6
7
# File 'lib/wip/runner/workflow/builder/task.rb', line 5

def heading
  @heading
end

#stepsObject (readonly)

Returns the value of attribute steps.



5
6
7
# File 'lib/wip/runner/workflow/builder/task.rb', line 5

def steps
  @steps
end

Instance Method Details

#step(name, &block) ⇒ Object



14
15
16
# File 'lib/wip/runner/workflow/builder/task.rb', line 14

def step(name, &block)
  steps << Builder::Step.new(@command, name, &block)
end