Class: MundaneSearch::ParamKeyTypes

Inherits:
Object
  • Object
show all
Defined in:
lib/mundane-search/param_key_types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, filter) ⇒ ParamKeyTypes

Returns a new instance of ParamKeyTypes.



4
5
6
# File 'lib/mundane-search/param_key_types.rb', line 4

def initialize(options, filter)
  @options, @filter = options, filter
end

Instance Attribute Details

#filterObject (readonly)

Returns the value of attribute filter.



3
4
5
# File 'lib/mundane-search/param_key_types.rb', line 3

def filter
  @filter
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/mundane-search/param_key_types.rb', line 3

def options
  @options
end

Instance Method Details

#pairsObject



8
9
10
11
12
13
14
# File 'lib/mundane-search/param_key_types.rb', line 8

def pairs
  kt = key_types
  option_keys.inject({}) do |hsh, key|
    hsh[options[key]] = kt["#{key}"] || kt[:"#{key}"]
    hsh
  end
end