Edge is used for block passed to Create#edge, used to configure edges in the property graph.
Constants
| Data | = | Struct.new(:name, :key, :labels, :source, :destination) |
Public Class methods
new(name, opts=OPTS, &block)
In addition to inherited behavior, raises an error if a block is not passed or source or destination is not called in the block.
[show source]
# 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()
[show 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)
Specify the destination for the edge, with block evaluted by Target.
[show source]
# 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)
Specify the source for the edge, with block evaluted by Target.
[show source]
# 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