Sha256: 9648c71a46015abc7fbd4d291c0166f0f3ab8266ae564c8a87bb2a2884f69e79
Contents?: true
Size: 874 Bytes
Versions: 3
Compression:
Stored size: 874 Bytes
Contents
# encoding: utf-8 module ROM # Schema builder DSL # class Schema include Concord.new(:definition), Adamantium::Flat # Build a relation schema # # @example # # Schema.build do # base_relation :users do # repository :test # attribute :id, :name # end # end # # @return [Schema] # # @api public def self.build(repositories, &block) new(Definition.new(repositories, &block)) end # Return defined relation identified by name # # @example # # schema[:users] # => #<Axiom::Relation::Base ..> # # @return [Axiom::Relation, Axiom::Relation::Base] # # @api public def [](name) definition[name] end # @api private def call(&block) definition.instance_eval(&block) self end end # Schema end # ROM
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rom-relation-0.1.2 | lib/rom/schema.rb |
rom-relation-0.1.1 | lib/rom/schema.rb |
rom-relation-0.1.0 | lib/rom/schema.rb |