Class: Artisanal::Model::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/artisanal/model/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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={})
  @options = options
  @defaults = { optional: true }.merge(options.fetch(:defaults, {}))
  @writable = options.fetch(:writable, false)
  @undefined = options.fetch(:undefined, false)
  @symbolize = options.fetch(:symbolize, false)
end

Instance Attribute Details

#defaultsObject (readonly)

Returns the value of attribute defaults.



3
4
5
# File 'lib/artisanal/model/config.rb', line 3

def defaults
  @defaults
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/artisanal/model/config.rb', line 3

def options
  @options
end

#symbolizeObject (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

#undefinedObject (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

#writableObject (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