Class: Rley::GFG::GrmFlowGraph::Branching

Inherits:
Struct
  • Object
show all
Defined in:
lib/rley/gfg/grm_flow_graph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(aVertex) ⇒ Branching

Returns a new instance of Branching.



50
51
52
53
54
# File 'lib/rley/gfg/grm_flow_graph.rb', line 50

def initialize(aVertex)
  super(aVertex)
  self.to_visit = aVertex.edges.dup
  self.visited = []
end

Instance Attribute Details

#to_visitObject

Returns the value of attribute to_visit

Returns:

  • (Object)

    the current value of to_visit



49
50
51
# File 'lib/rley/gfg/grm_flow_graph.rb', line 49

def to_visit
  @to_visit
end

#vertexObject

Returns the value of attribute vertex

Returns:

  • (Object)

    the current value of vertex



49
50
51
# File 'lib/rley/gfg/grm_flow_graph.rb', line 49

def vertex
  @vertex
end

#visitedObject

Returns the value of attribute visited

Returns:

  • (Object)

    the current value of visited



49
50
51
# File 'lib/rley/gfg/grm_flow_graph.rb', line 49

def visited
  @visited
end

Instance Method Details

#done?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/rley/gfg/grm_flow_graph.rb', line 56

def done?
  to_visit.empty?
end

#next_edgeObject



60
61
62
63
64
65
# File 'lib/rley/gfg/grm_flow_graph.rb', line 60

def next_edge
  next_one = to_visit.shift
  visited << next_one.successor unless next_one.nil?

  return next_one
end