Class: GraphElements::Vertex
- Inherits:
-
Object
- Object
- GraphElements::Vertex
- Defined in:
- lib/social_framework/graphs/graph_elements.rb
Overview
Define abstract methods to Vertex
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
The attributes of vertex.
-
#edges ⇒ Object
The attributes of vertex.
-
#id ⇒ Object
The attributes of vertex.
-
#type ⇒ Object
The attributes of vertex.
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
Overriding equal method Returns NotImplementedError.
-
#add_edge(destiny, label = "") ⇒ Object
- Method to add edges to vertex ====== Params:
destiny
Vertex
destiny to edgelabel
-
String
label to edge Returns NotImplementedError.
- Method to add edges to vertex ====== Params:
-
#hash ⇒ Object
Overriding hash method Returns NotImplementedError.
-
#initialize(id, type, attributes) ⇒ Vertex
constructor
- Constructor to vertex ====== Params:
id
Integer
vertex idtype
Class
of vertexattributes
-
Hash
aditional attributes of vertex Returns NotImplementedError.
- Constructor to vertex ====== Params:
Constructor Details
#initialize(id, type, attributes) ⇒ Vertex
Constructor to vertex
Params:
id
-
Integer
vertex id type
-
Class
of vertex attributes
-
Hash
aditional attributes of vertex
Returns NotImplementedError
15 16 17 |
# File 'lib/social_framework/graphs/graph_elements.rb', line 15 def initialize id, type, attributes raise 'Must implement method in subclass' end |
Instance Attribute Details
#attributes ⇒ Object
The attributes of vertex
7 8 9 |
# File 'lib/social_framework/graphs/graph_elements.rb', line 7 def attributes @attributes end |
#edges ⇒ Object
The attributes of vertex
7 8 9 |
# File 'lib/social_framework/graphs/graph_elements.rb', line 7 def edges @edges end |
#id ⇒ Object
The attributes of vertex
7 8 9 |
# File 'lib/social_framework/graphs/graph_elements.rb', line 7 def id @id end |
#type ⇒ Object
The attributes of vertex
7 8 9 |
# File 'lib/social_framework/graphs/graph_elements.rb', line 7 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
Overriding equal method Returns NotImplementedError
21 22 23 |
# File 'lib/social_framework/graphs/graph_elements.rb', line 21 def ==(other) raise 'Must implement method in subclass' end |
#add_edge(destiny, label = "") ⇒ Object
Method to add edges to vertex
Params:
destiny
-
Vertex
destiny to edge label
-
String
label to edge
Returns NotImplementedError
38 39 40 |
# File 'lib/social_framework/graphs/graph_elements.rb', line 38 def add_edge destiny, label = "" raise 'Must implement method in subclass' end |
#hash ⇒ Object
Overriding hash method Returns NotImplementedError
29 30 31 |
# File 'lib/social_framework/graphs/graph_elements.rb', line 29 def hash raise 'Must implement method in subclass' end |