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
28 29 30 31 32 33 34 35 36 |
# File 'lib/declarative/schema.rb', line 28 def defaults(={}, &block) heritage.record(:defaults, , &block) # Always convert arrays to Variables::Append instructions. = .merge( Defaults.wrap_arrays() ) block = wrap_arrays_from_block(block) if block_given? _defaults.merge!(, &block) end |
#definition_class ⇒ Object
TODO: test me.
42 43 44 |
# File 'lib/declarative/schema.rb', line 42 def definition_class # TODO: test me. Definitions::Definition end |
#definitions ⇒ Object
38 39 40 |
# File 'lib/declarative/schema.rb', line 38 def definitions @definitions ||= Definitions.new(definition_class) end |
#property(name, options = {}, &block) ⇒ Object
22 23 24 25 26 |
# File 'lib/declarative/schema.rb', line 22 def property(name, ={}, &block) heritage.record(:property, name, , &block) build_definition(name, , &block) end |