class Mechanical::Schema

Attributes

models[R]

Public Class Methods

new() click to toggle source
# File lib/mechanical.rb, line 10
def initialize
  @models = {}
end

Public Instance Methods

[](name) click to toggle source
# File lib/mechanical.rb, line 20
def [](name)
  @models[name]
end
model(name, &block) click to toggle source
# File lib/mechanical.rb, line 14
def model(name, &block)
  model = Model.new(name)
  model.instance_eval(&block)
  @models[name] = model
end