Class: Flows::Flow::Router Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/flows/flow/router.rb,
lib/flows/flow/router/custom.rb,
lib/flows/flow/router/errors.rb,
lib/flows/flow/router/simple.rb

Overview

This class is abstract.

Node router: defines rules to calculate next Node to execute inside a particular Flows::Flow.

Router receives Result Object, execution context and execution metadata. Basing on this information a router must decide what to execute next or decide to stop execution of a flow.

If router returns :end - it stops an execution process.

Since:

  • 0.4.0

Direct Known Subclasses

Custom, Simple

Defined Under Namespace

Classes: Custom, Error, NoRouteError, Simple

Instance Method Summary collapse

Instance Method Details

#call(result) ⇒ Symbol

This method is abstract.

Returns name of the next node or a special symbol :end.

Parameters:

Returns:

  • (Symbol)

    name of the next node or a special symbol :end.

Raises:



22
23
# File 'lib/flows/flow/router.rb', line 22

class Router
end

#destinationsArray<Symbol>

This method is abstract.

Returns names of all the possible destination nodes.

Returns:

  • (Array<Symbol>)

    names of all the possible destination nodes



22
23
# File 'lib/flows/flow/router.rb', line 22

class Router
end