Class: DepCheck::Node
- Inherits:
-
Object
- Object
- DepCheck::Node
- Defined in:
- lib/dep_check/Node.rb
Instance Attribute Summary collapse
-
#edges ⇒ Object
Returns the value of attribute edges.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #addEdge(node) ⇒ Object
-
#initialize(name) ⇒ Node
constructor
A new instance of Node.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Node
6 7 8 9 |
# File 'lib/dep_check/Node.rb', line 6 def initialize(name) @name = name @edges = [] end |
Instance Attribute Details
#edges ⇒ Object
Returns the value of attribute edges.
4 5 6 |
# File 'lib/dep_check/Node.rb', line 4 def edges @edges end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/dep_check/Node.rb', line 5 def name @name end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/dep_check/Node.rb', line 15 def ==(other) @name == other.name end |
#addEdge(node) ⇒ Object
11 12 13 |
# File 'lib/dep_check/Node.rb', line 11 def addEdge(node) @edges.push(node) end |
#to_hash ⇒ Object
19 20 21 |
# File 'lib/dep_check/Node.rb', line 19 def to_hash {:name=>@name,:edges=>@edges} end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/dep_check/Node.rb', line 23 def to_s @name end |