Module: Artisanal::Model::DSL
- Defined in:
- lib/artisanal/model/dsl.rb
Defined Under Namespace
Modules: InstanceMethods
Class Method Summary collapse
Instance Method Summary collapse
- #artisanal_model ⇒ Object
- #attribute(*args, **kwargs) ⇒ Object
- #inherited(subclass) ⇒ Object
- #schema ⇒ Object
Class Method Details
.extended(base) ⇒ Object
6 7 8 9 |
# File 'lib/artisanal/model/dsl.rb', line 6 def self.extended(base) base.prepend Initializer base.include InstanceMethods end |
Instance Method Details
#artisanal_model ⇒ Object
16 17 18 |
# File 'lib/artisanal/model/dsl.rb', line 16 def artisanal_model @artisanal_model ||= Model.new(self) end |
#attribute(*args, **kwargs) ⇒ Object
24 25 26 |
# File 'lib/artisanal/model/dsl.rb', line 24 def attribute(*args, **kwargs) artisanal_model.attribute(*args, **kwargs) end |
#inherited(subclass) ⇒ Object
11 12 13 14 |
# File 'lib/artisanal/model/dsl.rb', line 11 def inherited(subclass) subclass.include Artisanal::Model(**artisanal_model.config.) super(subclass) end |
#schema ⇒ Object
20 21 22 |
# File 'lib/artisanal/model/dsl.rb', line 20 def schema artisanal_model.schema end |