Class: Artisanal::Model::Builder
- Inherits:
-
Module
- Object
- Module
- Artisanal::Model::Builder
- Defined in:
- lib/artisanal/model/builder.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #included(base) ⇒ Object
-
#initialize(options = {}) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
permalink #initialize(options = {}) ⇒ Builder
Returns a new instance of Builder.
9 10 11 |
# File 'lib/artisanal/model/builder.rb', line 9 def initialize(={}) @config = Config.new() end |
Instance Attribute Details
permalink #config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/artisanal/model/builder.rb', line 7 def config @config end |
Instance Method Details
permalink #included(base) ⇒ Object
[View source]
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/artisanal/model/builder.rb', line 13 def included(base) base.extend Dry::Initializer[undefined: config.undefined?] base.extend Artisanal::Model::DSL # Make attributes mutable define_writers if config.writable? # Store artisanal model config base.artisanal_model.config = config end |