Module: FastSerializer::Utils

Defined in:
lib/fast_serializer/utils.rb

Class Method Summary collapse

Class Method Details

.ref_merge(hash_a, hash_b) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/fast_serializer/utils.rb', line 11

def self.ref_merge(hash_a, hash_b)
  return if hash_a.equal?(hash_b)

  hash_b.each do |key, value|
    hash_a[key] = value
  end
end

.symbolize_keys(hash) ⇒ Object



5
6
7
8
9
# File 'lib/fast_serializer/utils.rb', line 5

def self.symbolize_keys(hash)
  res = {}
  hash.each { |key, value| res[key.to_sym] = value }
  res
end