class Sequel::Postgres::PropertyGraph::Generator::Edge
Edge is used for block passed to Create#edge, used to configure edges in the property graph.
Constants
- Data
Public Class Methods
new(name, opts=OPTS, &block)
click to toggle source
In addition to inherited behavior, raises an error if a block is not passed or source or destination is not called in the block.
Calls superclass method
Sequel::Postgres::PropertyGraph::Generator::Element::new
# File lib/sequel/adapters/shared/postgres.rb 397 def initialize(name, opts=OPTS, &block) 398 super 399 400 unless @source && @destination 401 raise Error, "source and/or destination not defined for property graph edge" 402 end 403 end
Public Instance Methods
data()
click to toggle source
# File lib/sequel/adapters/shared/postgres.rb 405 def data 406 Data.new(@name, @key, @labels, @source, @destination).freeze 407 end
destination(name, &block)
click to toggle source
Specify the destination for the edge, with block evaluted by Target.
# File lib/sequel/adapters/shared/postgres.rb 416 def destination(name, &block) 417 raise Error, "cannot specify multiple destinations for a property graph edge" if @destination 418 @destination = Target.new(name, &block) 419 end
source(name, &block)
click to toggle source
Specify the source for the edge, with block evaluted by Target.
# File lib/sequel/adapters/shared/postgres.rb 410 def source(name, &block) 411 raise Error, "cannot specify multiple sources for a property graph edge" if @source 412 @source = Target.new(name, &block) 413 end