Class: Smith::Workflow::Graph
- Inherits:
-
Object
- Object
- Smith::Workflow::Graph
- Defined in:
- lib/smith/workflow/graph.rb,
lib/smith/workflow/graph/report.rb,
lib/smith/workflow/graph/metrics.rb,
lib/smith/workflow/graph/targets.rb,
lib/smith/workflow/graph/reference.rb,
lib/smith/workflow/graph/validator.rb,
lib/smith/workflow/graph/diagnostic.rb,
lib/smith/workflow/graph/reachability.rb,
lib/smith/workflow/graph/state_diagnostics.rb,
lib/smith/workflow/graph/transition_snapshot.rb,
lib/smith/workflow/graph/transition_diagnostics.rb,
lib/smith/workflow/graph/reachability_diagnostics.rb
Defined Under Namespace
Modules: Reference Classes: Diagnostic, Metrics, Reachability, ReachabilityDiagnostics, Report, StateDiagnostics, Targets, TransitionDiagnostics, TransitionSnapshot, Validator
Instance Attribute Summary collapse
-
#initial_state ⇒ Object
readonly
Returns the value of attribute initial_state.
-
#states ⇒ Object
readonly
Returns the value of attribute states.
-
#transitions ⇒ Object
readonly
Returns the value of attribute transitions.
-
#workflow_class ⇒ Object
readonly
Returns the value of attribute workflow_class.
Instance Method Summary collapse
-
#initialize(workflow_class:, initial_state:, states:, transitions:) ⇒ Graph
constructor
A new instance of Graph.
- #transition_snapshots ⇒ Object
- #validate ⇒ Object
Constructor Details
#initialize(workflow_class:, initial_state:, states:, transitions:) ⇒ Graph
Returns a new instance of Graph.
8 9 10 11 12 13 |
# File 'lib/smith/workflow/graph.rb', line 8 def initialize(workflow_class:, initial_state:, states:, transitions:) @workflow_class = workflow_class @initial_state = initial_state @states = Array(states).uniq.freeze @transitions = transitions.dup.freeze end |
Instance Attribute Details
#initial_state ⇒ Object (readonly)
Returns the value of attribute initial_state.
6 7 8 |
# File 'lib/smith/workflow/graph.rb', line 6 def initial_state @initial_state end |
#states ⇒ Object (readonly)
Returns the value of attribute states.
6 7 8 |
# File 'lib/smith/workflow/graph.rb', line 6 def states @states end |
#transitions ⇒ Object (readonly)
Returns the value of attribute transitions.
6 7 8 |
# File 'lib/smith/workflow/graph.rb', line 6 def transitions @transitions end |
#workflow_class ⇒ Object (readonly)
Returns the value of attribute workflow_class.
6 7 8 |
# File 'lib/smith/workflow/graph.rb', line 6 def workflow_class @workflow_class end |
Instance Method Details
#transition_snapshots ⇒ Object
19 20 21 |
# File 'lib/smith/workflow/graph.rb', line 19 def transition_snapshots transitions.values.map { |transition| TransitionSnapshot.from_transition(transition) } end |