Module: Dialekt::Dsl::ClassMixins
- Defined in:
- lib/dialekt/dsl.rb
Overview
DSL mixins for Class
Instance Method Summary collapse
- #dsl_map(name, **options, &block) ⇒ Object
- #dsl_scalar(name, **options, &block) ⇒ Object
- #dsl_set(name, **options, &block) ⇒ Object
Instance Method Details
#dsl_map(name, **options, &block) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/dialekt/dsl.rb', line 15 def dsl_map(name, **, &block) property = Model::MapProperty.new(name: name, **) Docile.dsl_eval(property, &block) if block property.setup(owner: self) property end |
#dsl_scalar(name, **options, &block) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/dialekt/dsl.rb', line 8 def dsl_scalar(name, **, &block) property = Model::ScalarProperty.new(name: name, **) Docile.dsl_eval(property, &block) if block property.setup(owner: self) property end |
#dsl_set(name, **options, &block) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/dialekt/dsl.rb', line 22 def dsl_set(name, **, &block) property = Model::SetProperty.new(name: name, **) Docile.dsl_eval(property, &block) if block property.setup(owner: self) property end |