Class: Conductor::Workflow::Dsl::OutputRef
- Inherits:
-
Object
- Object
- Conductor::Workflow::Dsl::OutputRef
- Defined in:
- lib/conductor/workflow/dsl/output_ref.rb
Overview
OutputRef enables chained [] access for nested output paths task[:body][:items] => "$task_reftask_ref.outputtask_ref.output.responsetask_ref.output.response.bodytask_ref.output.response.body.items"
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
Compare OutputRefs by their paths.
-
#[](field) ⇒ OutputRef
Enable chained [] access.
- #hash ⇒ Object
-
#initialize(path) ⇒ OutputRef
constructor
A new instance of OutputRef.
-
#to_s ⇒ String
(also: #to_str)
Convert to expression string for use in input parameters.
Constructor Details
#initialize(path) ⇒ OutputRef
Returns a new instance of OutputRef.
11 12 13 |
# File 'lib/conductor/workflow/dsl/output_ref.rb', line 11 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/conductor/workflow/dsl/output_ref.rb', line 9 def path @path end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
Compare OutputRefs by their paths
32 33 34 |
# File 'lib/conductor/workflow/dsl/output_ref.rb', line 32 def ==(other) other.is_a?(OutputRef) && @path == other.path end |
#[](field) ⇒ OutputRef
Enable chained [] access
18 19 20 |
# File 'lib/conductor/workflow/dsl/output_ref.rb', line 18 def [](field) OutputRef.new("#{@path}.#{field}") end |
#hash ⇒ Object
38 39 40 |
# File 'lib/conductor/workflow/dsl/output_ref.rb', line 38 def hash @path.hash end |
#to_s ⇒ String Also known as: to_str
Convert to expression string for use in input parameters
24 25 26 |
# File 'lib/conductor/workflow/dsl/output_ref.rb', line 24 def to_s "${#{@path}}" end |