Class: FlowObject::Base

Inherits:
Object
  • Object
show all
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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

.inObject (readonly)

Returns the value of attribute in.



12
13
14
# File 'lib/flow_object/base.rb', line 12

def in
  @in
end

.outObject (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

#callbacksObject (readonly)

Returns the value of attribute callbacks.



18
19
20
# File 'lib/flow_object/base.rb', line 18

def callbacks
  @callbacks
end

#outputObject (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_successObject



35
36
37
# File 'lib/flow_object/base.rb', line 35

def on_success
  # NOOP
end