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 | = | Struct.new(:vertices, :edges) |
Public Class methods
new(&block)
[show 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()
[show source]
# File lib/sequel/adapters/shared/postgres.rb 436 def data 437 Data.new(@vertices, @edges).freeze 438 end
edge(name, opts=OPTS, &block)
Adds an edge to the property graph, with the block evaluted by Edge.
[show source]
# 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)
Adds a vertex to the property graph, with the block evaluted by Vertex.
[show source]
# File lib/sequel/adapters/shared/postgres.rb 441 def vertex(name, opts=OPTS, &block) 442 @vertices << Vertex.new(name, opts, &block) 443 end