Class: Silicium::Graphs::Node
- Inherits:
-
Object
- Object
- Silicium::Graphs::Node
- Defined in:
- lib/topological_sort.rb
Instance Attribute Summary collapse
-
#adjacents ⇒ Object
Returns the value of attribute adjacents.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Node
constructor
A new instance of Node.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Node
Returns a new instance of Node.
20 21 22 23 24 |
# File 'lib/topological_sort.rb', line 20 def initialize(name) # using Set instead of an Array to avoid duplications @adjacents = Set.new @name = name end |
Instance Attribute Details
#adjacents ⇒ Object
Returns the value of attribute adjacents.
18 19 20 |
# File 'lib/topological_sort.rb', line 18 def adjacents @adjacents end |
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/topological_sort.rb', line 18 def name @name end |
Instance Method Details
#to_s ⇒ Object
26 27 28 |
# File 'lib/topological_sort.rb', line 26 def to_s @name end |