Module: Parametric::DSL::ClassMethods
- Defined in:
- lib/parametric/dsl.rb
Instance Method Summary collapse
- #after_define_schema(sc) ⇒ Object
- #inherited(subclass) ⇒ Object
- #schema(options = {}, &block) ⇒ Object
- #schema=(sc) ⇒ Object
Instance Method Details
#after_define_schema(sc) ⇒ Object
47 48 49 |
# File 'lib/parametric/dsl.rb', line 47 def after_define_schema(sc) # noop hook end |
#inherited(subclass) ⇒ Object
35 36 37 |
# File 'lib/parametric/dsl.rb', line 35 def inherited(subclass) subclass.schema = @schema.merge(Parametric::Schema.new) end |
#schema(options = {}, &block) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/parametric/dsl.rb', line 39 def schema( = {}, &block) return @schema unless .any? || block_given? new_schema = Parametric::Schema.new(, &block) @schema = @schema.merge(new_schema) after_define_schema(@schema) end |
#schema=(sc) ⇒ Object
31 32 33 |
# File 'lib/parametric/dsl.rb', line 31 def schema=(sc) @schema = sc end |