Class: FlowObject::Base
- Inherits:
-
Object
- Object
- FlowObject::Base
- Extended by:
- ClassMethods, Forwardable
- Includes:
- Hospodar, Hospodar::Builder
- Defined in:
- lib/flow_object/base.rb
Overview
Provides DSL for flows definitions
Defined Under Namespace
Modules: ClassMethods
Class Attribute Summary collapse
-
.in ⇒ Object
readonly
Returns the value of attribute in.
-
.out ⇒ Object
readonly
Returns the value of attribute out.
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(flow, callbacks, step_name = :flow) ⇒ Base
constructor
A new instance of Base.
- #on_exception(exception = nil) ⇒ Object
- #on_failure(failed_step = nil) ⇒ Object
- #on_success ⇒ Object
Methods included from ClassMethods
call, flow, from, inherited, to
Constructor Details
#initialize(flow, callbacks, step_name = :flow) ⇒ Base
Returns a new instance of Base.
20 21 22 23 24 25 |
# File 'lib/flow_object/base.rb', line 20 def initialize(flow, callbacks, step_name = :flow) @output = self.class.send(:fo_wrap_output) @callbacks = callbacks Hospodar::Builder.def_accessor(step_name, on: @output, to: flow, delegate: true) output_initialized.call(@output) end |
Class Attribute Details
.in ⇒ Object (readonly)
Returns the value of attribute in.
12 13 14 |
# File 'lib/flow_object/base.rb', line 12 def in @in end |
.out ⇒ Object (readonly)
Returns the value of attribute out.
12 13 14 |
# File 'lib/flow_object/base.rb', line 12 def out @out end |
Instance Attribute Details
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
18 19 20 |
# File 'lib/flow_object/base.rb', line 18 def callbacks @callbacks end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
18 19 20 |
# File 'lib/flow_object/base.rb', line 18 def output @output end |
Instance Method Details
#on_exception(exception = nil) ⇒ Object
27 28 29 |
# File 'lib/flow_object/base.rb', line 27 def on_exception(exception = nil) # NOOP end |
#on_failure(failed_step = nil) ⇒ Object
31 32 33 |
# File 'lib/flow_object/base.rb', line 31 def on_failure(failed_step = nil) # NOOP end |
#on_success ⇒ Object
35 36 37 |
# File 'lib/flow_object/base.rb', line 35 def on_success # NOOP end |