Class: DirectedGraph::Vertex
- Inherits:
-
Object
- Object
- DirectedGraph::Vertex
- Defined in:
- lib/directed_graph/vertex.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(args) ⇒ Vertex
constructor
A new instance of Vertex.
Constructor Details
#initialize(args) ⇒ Vertex
Returns a new instance of Vertex.
8 9 10 11 |
# File 'lib/directed_graph/vertex.rb', line 8 def initialize(args) @name = args.fetch(:name) @data = args.fetch(:data, {}) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
6 7 8 |
# File 'lib/directed_graph/vertex.rb', line 6 def data @data end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/directed_graph/vertex.rb', line 5 def name @name end |