Class: Artisanal::Model::Config
- Inherits:
-
Object
- Object
- Artisanal::Model::Config
- Defined in:
- lib/artisanal/model/config.rb
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#symbolize ⇒ Object
(also: #symbolize?)
readonly
Returns the value of attribute symbolize.
-
#undefined ⇒ Object
(also: #undefined?)
readonly
Returns the value of attribute undefined.
-
#writable ⇒ Object
(also: #writable?)
readonly
Returns the value of attribute writable.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 15 |
# File 'lib/artisanal/model/config.rb', line 9 def initialize(={}) @options = @defaults = { optional: true }.merge(.fetch(:defaults, {})) @writable = .fetch(:writable, false) @undefined = .fetch(:undefined, false) @symbolize = .fetch(:symbolize, false) end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
3 4 5 |
# File 'lib/artisanal/model/config.rb', line 3 def defaults @defaults end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/artisanal/model/config.rb', line 3 def @options end |
#symbolize ⇒ Object (readonly) Also known as: symbolize?
Returns the value of attribute symbolize.
3 4 5 |
# File 'lib/artisanal/model/config.rb', line 3 def symbolize @symbolize end |
#undefined ⇒ Object (readonly) Also known as: undefined?
Returns the value of attribute undefined.
3 4 5 |
# File 'lib/artisanal/model/config.rb', line 3 def undefined @undefined end |
#writable ⇒ Object (readonly) Also known as: writable?
Returns the value of attribute writable.
3 4 5 |
# File 'lib/artisanal/model/config.rb', line 3 def writable @writable end |