Class: Floe::Workflow::States::Pass
- Inherits:
-
Floe::Workflow::State
- Object
- Floe::Workflow::State
- Floe::Workflow::States::Pass
- Includes:
- InputOutputMixin, NonTerminalMixin
- Defined in:
- lib/floe/workflow/states/pass.rb
Instance Attribute Summary collapse
-
#end ⇒ Object
readonly
Returns the value of attribute end.
-
#input_path ⇒ Object
readonly
Returns the value of attribute input_path.
-
#next ⇒ Object
readonly
Returns the value of attribute next.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#result_path ⇒ Object
readonly
Returns the value of attribute result_path.
Attributes inherited from Floe::Workflow::State
#comment, #name, #payload, #type
Instance Method Summary collapse
- #end? ⇒ Boolean
- #finish(context) ⇒ Object
-
#initialize(workflow, name, payload) ⇒ Pass
constructor
A new instance of Pass.
- #running?(_) ⇒ Boolean
Methods included from NonTerminalMixin
Methods included from InputOutputMixin
#process_input, #process_output
Methods inherited from Floe::Workflow::State
build!, #finished?, #long_name, #mark_error, #mark_finished, #mark_started, #ready?, #run_nonblock!, #short_name, #start, #started?, #wait, #wait_until, #waiting?
Methods included from ValidationMixin
included, #invalid_field_error!, #missing_field_error!, #parser_error!, #runtime_field_error!, #workflow_state?, #wrap_parser_error
Constructor Details
#initialize(workflow, name, payload) ⇒ Pass
Returns a new instance of Pass.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/floe/workflow/states/pass.rb', line 12 def initialize(workflow, name, payload) super @next = payload["Next"] @end = !!payload["End"] @result = payload["Result"] @parameters = PayloadTemplate.new(payload["Parameters"]) if payload["Parameters"] @input_path = Path.new(payload.fetch("InputPath", "$")) @output_path = Path.new(payload.fetch("OutputPath", "$")) @result_path = ReferencePath.new(payload.fetch("ResultPath", "$")) validate_state!(workflow) end |
Instance Attribute Details
#end ⇒ Object (readonly)
Returns the value of attribute end.
10 11 12 |
# File 'lib/floe/workflow/states/pass.rb', line 10 def end @end end |
#input_path ⇒ Object (readonly)
Returns the value of attribute input_path.
10 11 12 |
# File 'lib/floe/workflow/states/pass.rb', line 10 def input_path @input_path end |
#next ⇒ Object (readonly)
Returns the value of attribute next.
10 11 12 |
# File 'lib/floe/workflow/states/pass.rb', line 10 def next @next end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
10 11 12 |
# File 'lib/floe/workflow/states/pass.rb', line 10 def output_path @output_path end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
10 11 12 |
# File 'lib/floe/workflow/states/pass.rb', line 10 def parameters @parameters end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
10 11 12 |
# File 'lib/floe/workflow/states/pass.rb', line 10 def result @result end |
#result_path ⇒ Object (readonly)
Returns the value of attribute result_path.
10 11 12 |
# File 'lib/floe/workflow/states/pass.rb', line 10 def result_path @result_path end |
Instance Method Details
#end? ⇒ Boolean
37 38 39 |
# File 'lib/floe/workflow/states/pass.rb', line 37 def end? @end end |
#finish(context) ⇒ Object
27 28 29 30 31 |
# File 'lib/floe/workflow/states/pass.rb', line 27 def finish(context) input = result.nil? ? process_input(context) : result context.output = process_output(context, input) super end |
#running?(_) ⇒ Boolean
33 34 35 |
# File 'lib/floe/workflow/states/pass.rb', line 33 def running?(_) false end |