Class: Flows::Railway::Step Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/flows/railway/step.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lambdaObject

Returns the value of attribute lambda

Returns:

  • (Object)

    the current value of lambda



12
13
14
# File 'lib/flows/railway/step.rb', line 12

def lambda
  @lambda
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



12
13
14
# File 'lib/flows/railway/step.rb', line 12

def name
  @name
end

#next_stepObject

Returns the value of attribute next_step

Returns:

  • (Object)

    the current value of next_step



12
13
14
# File 'lib/flows/railway/step.rb', line 12

def next_step
  @next_step
end

Instance Method Details

#to_node(method_source) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



13
14
15
16
17
18
19
20
21
# File 'lib/flows/railway/step.rb', line 13

def to_node(method_source)
  Flows::Flow::Node.new(
    body: lambda || method_source.method(name),
    router: Flows::Flow::Router::Simple.new(next_step || :end, :end),
    meta: { name: name },
    preprocessor: NODE_PREPROCESSOR,
    postprocessor: NODE_POSTPROCESSOR
  )
end