Class: ElementsFactoryDefault
- Inherits:
-
ElementsFactory
- Object
- ElementsFactory
- ElementsFactoryDefault
- Defined in:
- lib/social_framework/graphs/elements_factory_default.rb
Overview
Implements the methods to create vertices and edges
Instance Method Summary collapse
-
#create_edge(origin, destiny) ⇒ Object
- Create a default edge ====== Params:
origin
Vertex
relationship origindestiny
-
Vertex
relationship destiny Returns GraphElements::EdgeDefault object.
- Create a default edge ====== Params:
-
#create_vertex(id, type, attributes = {}) ⇒ Object
- Create a default vertex ====== Params:
id
Integer
vertex idtype
Class
of vertexattributes
-
Hash
aditional attributes of vertex Returns GraphElements::VertexDefault object.
- Create a default vertex ====== Params:
Instance Method Details
#create_edge(origin, destiny) ⇒ Object
Create a default edge
Params:
origin
-
Vertex
relationship origin destiny
-
Vertex
relationship destiny
Returns GraphElements::EdgeDefault object
19 20 21 |
# File 'lib/social_framework/graphs/elements_factory_default.rb', line 19 def create_edge origin, destiny return GraphElements::EdgeDefault.new origin, destiny end |
#create_vertex(id, type, attributes = {}) ⇒ Object
Create a default vertex
Params:
id
-
Integer
vertex id type
-
Class
of vertex attributes
-
Hash
aditional attributes of vertex
Returns GraphElements::VertexDefault object
10 11 12 |
# File 'lib/social_framework/graphs/elements_factory_default.rb', line 10 def create_vertex id, type, attributes = {} return GraphElements::VertexDefault.new id, type, attributes end |