lib/rom/environment.rb
# Build a relation schema for this environment
#
# @example
#   env = Environment.coerce(test: 'memory://test')
#
#   env.schema do
#     base_relation :users do
#       repository :test
#
#       attribute :id, Integer
#       attribute :name, String
#     end
#   end
#
# @return [Schema]
#
# @api public
Build a relation schema for this environment
Build a relation schema for this environment
def schema(&block)
      @schema ||= Schema.build(repositories)
      @schema.call(&block) if block
      @schema
    end
def schema ( & block ) @schema ||= Schema . build ( repositories ) @schema . call ( & block ) if block @schema end
Build a relation schema for this environment
Build a relation schema for this environment
None
Schema
block
example
env = Environment.coerce(test: 'memory://test') env.schema do base_relation :users do repository :test attribute :id, Integer attribute :name, String end end
env = Environment . coerce ( test : ' memory : // test ' ) env . schema do base_relation : users do repository : test attribute : id Integer attribute : name String end end
api
None