Class: Sequel::Postgres::PropertyGraph::Generator::Create
- Inherits:
-
Sequel::Postgres::PropertyGraph::Generator
- Object
- Sequel::Postgres::PropertyGraph::Generator
- Sequel::Postgres::PropertyGraph::Generator::Create
- Defined in:
- lib/sequel/adapters/shared/postgres.rb
Overview
Create is used to evaluate the block given to DatabaseMethods#create_property_graph, used to specify the vertices and edges in the property graph.
Defined Under Namespace
Classes: Data
Constant Summary
Constants inherited from Sequel::Postgres::PropertyGraph::Generator
Instance Method Summary collapse
- #data ⇒ Object
-
#edge(name, opts = OPTS, &block) ⇒ Object
Adds an edge to the property graph, with the block evaluted by Edge.
-
#initialize(&block) ⇒ Create
constructor
A new instance of Create.
-
#vertex(name, opts = OPTS, &block) ⇒ Object
Adds a vertex to the property graph, with the block evaluted by Vertex.
Methods inherited from Sequel::Postgres::PropertyGraph::Generator
Constructor Details
#initialize(&block) ⇒ Create
Returns a new instance of Create.
427 428 429 430 431 432 433 434 |
# File 'lib/sequel/adapters/shared/postgres.rb', line 427 def initialize(&block) @vertices = [] @edges = [] instance_exec(&block) @vertices.freeze @edges.freeze freeze end |
Instance Method Details
#data ⇒ Object
436 437 438 |
# File 'lib/sequel/adapters/shared/postgres.rb', line 436 def data Data.new(@vertices, @edges).freeze end |