Class: Orchestra::Recording::Node
- Inherits:
-
Object
- Object
- Orchestra::Recording::Node
- Extended by:
- Forwardable
- Defined in:
- lib/orchestra/recording/node.rb
Overview
Reader object to expose operations and steps to the outside world
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
Instance Method Summary collapse
-
#initialize(step_or_operation, name, input) ⇒ Node
constructor
A new instance of Node.
- #inspect ⇒ Object
- #operation? ⇒ Boolean
- #step? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(step_or_operation, name, input) ⇒ Node
Returns a new instance of Node.
12 13 14 15 16 17 |
# 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 |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
5 6 7 |
# File 'lib/orchestra/recording/node.rb', line 5 def input @input end |
Instance Method Details
#inspect ⇒ Object
30 31 32 33 34 35 |
# 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? ⇒ Boolean
37 38 39 |
# File 'lib/orchestra/recording/node.rb', line 37 def operation? @node.is_a? Operation end |
#step? ⇒ Boolean
41 42 43 |
# File 'lib/orchestra/recording/node.rb', line 41 def step? not operation? end |
#to_h ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# 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 |