Module: Declarative::Schema::DSL
- Defined in:
- lib/declarative/schema.rb
Instance Method Summary collapse
- #defaults(options = {}, &block) ⇒ Object
-
#definition_class ⇒ Object
TODO: test me.
- #definitions ⇒ Object
- #property(name, options = {}, &block) ⇒ Object
Instance Method Details
#defaults(options = {}, &block) ⇒ Object
25 26 27 28 29 |
# File 'lib/declarative/schema.rb', line 25 def defaults(={}, &block) heritage.record(:defaults, , &block) _defaults.merge!(, &block) end |
#definition_class ⇒ Object
TODO: test me.
35 36 37 |
# File 'lib/declarative/schema.rb', line 35 def definition_class # TODO: test me. Definitions::Definition end |
#definitions ⇒ Object
31 32 33 |
# File 'lib/declarative/schema.rb', line 31 def definitions @definitions ||= Definitions.new(definition_class) end |
#property(name, options = {}, &block) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/declarative/schema.rb', line 14 def property(name, ={}, &block) heritage.record(:property, name, , &block) = {} [:_base] = default_nested_class [:_defaults] = _defaults [:_nested_builder] = nested_builder if block definitions.add(name, .merge(), &block) end |