Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/sqlserver_schema_reflector/hash.rb

Instance Method Summary collapse

Instance Method Details

#find_hashes(keys) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/sqlserver_schema_reflector/hash.rb', line 8

def find_hashes(keys)
  h = symbolize_keys
  keys.each do |k|
    return nil unless h.keys.include? k
  end
  return h
end

#symbolize_keysObject



2
3
4
5
6
7
# File 'lib/sqlserver_schema_reflector/hash.rb', line 2

def symbolize_keys
  inject({}) do |options, (key, value)|
    options[(key.underscore.downcase.to_sym rescue key) || key] = value
    options
  end
end