lib/configliere/define.rb
def params_with(aspect)
      hsh = {}
      definitions.each do |param_name, param_def|
        next unless param_def.has_key?(aspect)
        hsh[param_name] = definition_of(param_name, aspect)
      end
      hsh
    end
# a hash holding every param with that aspect and its definition
#
# @example
#   @config.define :has_description,      :description => 'desc 1'
#   @config.define :also_has_description, :description => 'desc 2'
#   @config.define :no_description,       :something_else => 'foo'
#   #
#   params_with(:description)
#   # => { :has_description => 'desc 1', :also_has_description => 'desc 2' }
#
# @param aspect [Symbol] the aspect to list (:description, :type, :encrypted, etc.)
# @return [Hash]
a hash holding every param with that aspect and its definition
a hash holding every param with that aspect and its definition
def params_with(aspect)
      hsh = {}
      definitions.each do |param_name, param_def|
        next unless param_def.has_key?(aspect)
        hsh[param_name] = definition_of(param_name, aspect)
      end
      hsh
    end
def params_with ( aspect ) hsh = { } definitions . each do | param_name , param_def | next unless param_def . has_key? ( aspect ) hsh [ param_name ] = definition_of ( param_name , aspect ) end hsh end
a hash holding every param with that aspect and its definition
a hash holding every param with that aspect and its definition
None
Hash
aspect
the aspect to list (:description, :type, :encrypted, etc.)
the aspect to list ( : description : type : encrypted etc . )
example
@config.define :has_description, :description => 'desc 1' @config.define :also_has_description, :description => 'desc 2' @config.define :no_description, :something_else => 'foo' params_with(:description) # => { :has_description => 'desc 1', :also_has_description => 'desc 2' }
@config . define : has_description : description = > ' desc 1 ' @config . define : also_has_description : description = > ' desc 2 ' @config . define : no_description : something_else = > ' foo ' params_with ( : description ) # = > { : has_description = > ' desc 1 ' : also_has_description = > ' desc 2 ' }