Sha256: e95b98674212a051729755741ead4c8f2131510496e25953a166894bc60e6c0a

Contents?: true

Size: 717 Bytes

Versions: 2

Compression:

Stored size: 717 Bytes

Contents

# Implements the methods to create vertices and edges
class ElementsFactoryDefault < ElementsFactory

  # Create a default vertex
  # ====== Params:
  # +id+:: +Integer+ vertex id
  # +type+:: +Class+ of vertex
  # +attributes+:: +Hash+ aditional attributes of vertex
  # Returns GraphElements::VertexDefault object
  def create_vertex id, type, attributes = {}
    return GraphElements::VertexDefault.new id, type, attributes
  end

  # Create a default edge
  # ====== Params:
  # +origin+:: +Vertex+ relationship origin
  # +destiny+:: +Vertex+ relationship destiny
  # Returns GraphElements::EdgeDefault object
  def create_edge origin, destiny
    return GraphElements::EdgeDefault.new origin, destiny
  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_default.rb
social_framework-0.0.3 lib/social_framework/graphs/elements_factory_default.rb