Class: ReeHash::BuildFilterKeys

Inherits:
Object
  • Object
show all
Includes:
Ree::FnDSL
Defined in:
lib/ree_lib/packages/ree_hash/package/ree_hash/functions/build_filter_keys.rb

Instance Method Summary collapse

Instance Method Details

#call(keys) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ree_lib/packages/ree_hash/package/ree_hash/functions/build_filter_keys.rb', line 11

def call(keys)
  result = {}

  keys.each do |key|
    if key.is_a?(Symbol)
      result[key] = {}
    elsif key.is_a?(Hash)
      key.each do |k, key|
        result[k] = call(key)
      end
    end
  end

  result
end