Class: ElementsFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/social_framework/graphs/elements_factory.rb

Overview

Abstract class to provide methods to create elements to graph

Direct Known Subclasses

ElementsFactoryDefault

Instance Method Summary collapse

Instance Method Details

#create_edge(origin, destiny) ⇒ Object

Create a edge, must be implemented in concrete class

Params:
origin

Vertex relationship origin

destiny

Vertex relationship destiny

Returns NotImplementedError



19
20
21
# File 'lib/social_framework/graphs/elements_factory.rb', line 19

def create_edge origin, destiny
  raise 'Must implement method in subclass'
end

#create_vertex(id, type, attributes) ⇒ Object

Create a vertex, must be implemented in concrete class

Params:
id

Integer vertex id

type

Class of vertex

attributes

Hash aditional attributes of vertex

Returns NotImplementedError



10
11
12
# File 'lib/social_framework/graphs/elements_factory.rb', line 10

def create_vertex id, type, attributes
  raise 'Must implement method in subclass'
end