class Configliere::Param

Hash of fields to store.

Any field name beginning with ‘decrypted_’ automatically creates a counterpart ‘encrypted_’ field using the encrypt_pass.

Constants

USE_HANDLERS

@private

Public Class Methods

on_use(mw, &block) click to toggle source

Block executed when use is invoked

# File lib/configliere/param.rb, line 81
def self.on_use mw, &block
  USE_HANDLERS[mw] = block
end

Public Instance Methods

defaults(hsh) click to toggle source

Incorporates the given settings. alias for deep_merge! Existing values not given in the hash

@param hsh the defaults to set.

@example

Settings.defaults :hat => :cat, :basket => :lotion, :moon => { :man => :smiling }
Settings.defaults :basket => :tasket, :moon => { :cow => :smiling }
Config  #=> { :hat => :cat, :basket => :tasket, :moon => { :man => :smiling, :cow => :jumping } }

@return self

# File lib/configliere/param.rb, line 46
def defaults hsh
  deep_merge! hsh
  self
end
extractable_options?() click to toggle source
# File lib/configliere/param.rb, line 85
def extractable_options?
  true
end
resolve!() click to toggle source

Finalize and validate params. All include’d modules and subclasses must call super() @return self

Calls superclass method Configliere::ParamParent#resolve!
# File lib/configliere/param.rb, line 53
def resolve!
  super()
  validate!
  self
end
use(*mws) click to toggle source
# File lib/configliere/param.rb, line 66
def use *mws
  hsh = mws.pop if mws.last.is_a?(Hash)
  Configliere.use(*mws)
  mws.each do |mw|
    if (blk = USE_HANDLERS[mw])
      instance_eval(&blk)
    end
  end
  self.deep_merge!(hsh) if hsh
  self
end
validate!() click to toggle source

Check that all defined params are valid. All include’d modules and subclasses *must*call super() @return self

Calls superclass method Configliere::ParamParent#validate!
# File lib/configliere/param.rb, line 61
def validate!
  super()
  self
end