Sha256: 71b698267f8989dff000ed1726dc17e7b2fe20c1b9249af780fca07ad92d992f

Contents?: true

Size: 698 Bytes

Versions: 2

Compression:

Stored size: 698 Bytes

Contents

# Abstract class to provide methods to create elements to graph
class ElementsFactory

  # 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
  def create_vertex id, type, attributes
    raise 'Must implement method in subclass'
  end

  # Create a edge, must be implemented in concrete class
  # ====== Params:
  # +origin+:: +Vertex+ relationship origin
  # +destiny+:: +Vertex+ relationship destiny
  # Returns NotImplementedError
  def create_edge origin, destiny
    raise 'Must implement method in subclass'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
social_framework-1.0.1 lib/social_framework/graphs/elements_factory.rb
social_framework-0.0.3 lib/social_framework/graphs/elements_factory.rb