Class: CycleDetector::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/kwala/lib/cycle_detector.rb

Constant Summary collapse

DONE =
"DONE"
INPROGRESS =
"INPROGRESS"
UNVISITED =
"UNVISITED"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = self.object_id) ⇒ Node

Returns a new instance of Node.



223
224
225
226
227
# File 'lib/kwala/lib/cycle_detector.rb', line 223

def initialize( name = self.object_id )
  @name = name
  @edges = Array.new
  @state = UNVISITED
end

Instance Attribute Details

#edgesObject

Returns the value of attribute edges.



221
222
223
# File 'lib/kwala/lib/cycle_detector.rb', line 221

def edges
  @edges
end

#nameObject

Returns the value of attribute name.



221
222
223
# File 'lib/kwala/lib/cycle_detector.rb', line 221

def name
  @name
end

#stateObject

Returns the value of attribute state.



221
222
223
# File 'lib/kwala/lib/cycle_detector.rb', line 221

def state
  @state
end

Instance Method Details

#resetObject



229
230
231
# File 'lib/kwala/lib/cycle_detector.rb', line 229

def reset
  @state = UNVISITED
end