class Orchestra::Recording::Node

Reader object to expose operations and steps to the outside world

Attributes

input[RW]

Public Class Methods

new(step_or_operation, name, input) click to toggle source
# File lib/orchestra/recording/node.rb, line 12
def initialize step_or_operation, name, input
  @name = name
  @node = step_or_operation
  @input = format_input input
  freeze
end

Public Instance Methods

inspect() click to toggle source
# File lib/orchestra/recording/node.rb, line 30
def inspect
  params = to_h.each_with_object [] do |(key, val), list|
  list << "#{key}=#{val.inspect}"
  end
  "#<Orchestra::Node #{params.join ', '}>"
end
operation?() click to toggle source
# File lib/orchestra/recording/node.rb, line 37
def operation?
  @node.is_a? Operation
end
step?() click to toggle source
# File lib/orchestra/recording/node.rb, line 41
def step?
  not operation?
end
to_h() click to toggle source
# File lib/orchestra/recording/node.rb, line 19
def to_h
  {
    dependencies: dependencies,
    input: input,
    name: name,
    optional_dependencies: optional_dependencies,
    provisions: provisions,
    required_dependencies: required_dependencies,
  }
end

Private Instance Methods

format_input(input) click to toggle source
# File lib/orchestra/recording/node.rb, line 47
def format_input input
  @node.dependencies.each_with_object Hash.new do |dep, hsh|
    hsh[dep] = input[dep] if input.has_key? dep
  end
end