Class: DepCheck::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/dep_check/Node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#edgesObject

Returns the value of attribute edges.



4
5
6
# File 'lib/dep_check/Node.rb', line 4

def edges
  @edges
end

#nameObject

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_hashObject



19
20
21
# File 'lib/dep_check/Node.rb', line 19

def to_hash
  {:name=>@name,:edges=>@edges}
end

#to_sObject



23
24
25
# File 'lib/dep_check/Node.rb', line 23

def to_s
  @name
end