class ROM::Schema::Definition::Relation
Builder object for Axiom
relation
@private
Public Class Methods
new(&block)
click to toggle source
@api private
# File lib/rom/schema/definition/relation.rb, line 14 def initialize(&block) @header = [] @keys = [] instance_eval(&block) end
Public Instance Methods
attribute(name, type)
click to toggle source
@api private
# File lib/rom/schema/definition/relation.rb, line 31 def attribute(name, type) @header << [name, type] end
call(name)
click to toggle source
@api private
# File lib/rom/schema/definition/relation.rb, line 21 def call(name) Axiom::Relation::Base.new(name, header) end
header()
click to toggle source
@api private
# File lib/rom/schema/definition/relation.rb, line 26 def header Axiom::Relation::Header.coerce(@header, keys: @keys) end
key(*attribute_names)
click to toggle source
@api private
# File lib/rom/schema/definition/relation.rb, line 36 def key(*attribute_names) @keys.concat(attribute_names) end