Class: Orchestra::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/orchestra/step.rb,
lib/orchestra/step/output.rb

Direct Known Subclasses

InlineStep, ObjectStep

Defined Under Namespace

Classes: InlineStep, ObjectStep, Output

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Step

Returns a new instance of Step.



5
6
7
8
9
10
11
12
13
14
# File 'lib/orchestra/step.rb', line 5

def initialize args = {}
  @provisions,
  @collection,
  @dependencies = Util.extract_key_args(
    args,
    :provides      => [],
    :collection    => nil,
    :dependencies  => [],
  )
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



3
4
5
# File 'lib/orchestra/step.rb', line 3

def collection
  @collection
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



3
4
5
# File 'lib/orchestra/step.rb', line 3

def dependencies
  @dependencies
end

#provisionsObject (readonly)

Returns the value of attribute provisions.



3
4
5
# File 'lib/orchestra/step.rb', line 3

def provisions
  @provisions
end

Instance Method Details

#collection?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/orchestra/step.rb', line 24

def collection?
  collection ? true : false
end

#execute(input = {}) ⇒ Object



28
29
30
# File 'lib/orchestra/step.rb', line 28

def execute input = {}
  Execution.execute_step self, input
end

#optional_dependenciesObject



20
21
22
# File 'lib/orchestra/step.rb', line 20

def optional_dependencies
  defaults.keys
end

#process(raw_output) ⇒ Object



32
33
34
# File 'lib/orchestra/step.rb', line 32

def process raw_output
  Output.process self, raw_output
end

#required_dependenciesObject



16
17
18
# File 'lib/orchestra/step.rb', line 16

def required_dependencies
  dependencies - optional_dependencies
end