Class: Smith::Workflow::Graph::Reachability
- Inherits:
-
Object
- Object
- Smith::Workflow::Graph::Reachability
- Defined in:
- lib/smith/workflow/graph/reachability.rb
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
Instance Method Summary collapse
- #each_transition ⇒ Object
-
#initialize(graph) ⇒ Reachability
constructor
A new instance of Reachability.
- #transition_names ⇒ Object
Constructor Details
#initialize(graph) ⇒ Reachability
Returns a new instance of Reachability.
9 10 11 |
# File 'lib/smith/workflow/graph/reachability.rb', line 9 def initialize(graph) @graph = graph end |
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
7 8 9 |
# File 'lib/smith/workflow/graph/reachability.rb', line 7 def graph @graph end |
Instance Method Details
#each_transition ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/smith/workflow/graph/reachability.rb', line 17 def each_transition return enum_for(__method__) unless block_given? root = successors.initial_transition return unless root walk(root) { yield _1 } end |
#transition_names ⇒ Object
13 14 15 |
# File 'lib/smith/workflow/graph/reachability.rb', line 13 def transition_names each_transition.map(&:name) end |