Module: Declarative::Schema::DSL

Defined in:
lib/declarative/schema.rb

Instance Method Summary collapse

Instance Method Details

#defaults(options = {}, &block) ⇒ Object



27
28
29
30
31
# File 'lib/declarative/schema.rb', line 27

def defaults(options={}, &block)
  heritage.record(:defaults, options, &block)

  _defaults.merge!(options, &block)
end

#definition_classObject

TODO: test me.



37
38
39
# File 'lib/declarative/schema.rb', line 37

def definition_class # TODO: test me.
  Definitions::Definition
end

#definitionsObject



33
34
35
# File 'lib/declarative/schema.rb', line 33

def definitions
  @definitions ||= Definitions.new(definition_class)
end

#property(name, options = {}, &block) ⇒ Object



21
22
23
24
25
# File 'lib/declarative/schema.rb', line 21

def property(name, options={}, &block)
  heritage.record(:property, name, options, &block)

  build_definition(name, options, &block)
end