class Sequel::Postgres::PropertyGraph::Generator::Create

Create is used to evaluate the block given to DatabaseMethods#create_property_graph, used to specify the vertices and edges in the property graph.

Constants

Data

Public Class Methods

new(&block) click to toggle source
    # File lib/sequel/adapters/shared/postgres.rb
427 def initialize(&block)
428   @vertices = []
429   @edges = []
430   instance_exec(&block)
431   @vertices.freeze
432   @edges.freeze
433   freeze
434 end

Public Instance Methods

data() click to toggle source
    # File lib/sequel/adapters/shared/postgres.rb
436 def data
437   Data.new(@vertices, @edges).freeze
438 end
edge(name, opts=OPTS, &block) click to toggle source

Adds an edge to the property graph, with the block evaluted by Edge.

    # File lib/sequel/adapters/shared/postgres.rb
446 def edge(name, opts=OPTS, &block)
447   @edges << Edge.new(name, opts, &block)
448 end
vertex(name, opts=OPTS, &block) click to toggle source

Adds a vertex to the property graph, with the block evaluted by Vertex.

    # File lib/sequel/adapters/shared/postgres.rb
441 def vertex(name, opts=OPTS, &block)
442   @vertices << Vertex.new(name, opts, &block)
443 end