Module: JSONRB::Helpers

Included in:
Document
Defined in:
lib/jsonrb/helpers.rb

Instance Method Summary collapse

Instance Method Details

#merge(*hashes) ⇒ Hash

Merges multiple hashes together.

Examples:

one = { one: 1 }
two = { two: 2 }
three = { three: 3 }
merge(one, two, three) # => { one: 1, two: 2, three: 3 }


15
16
17
# File 'lib/jsonrb/helpers.rb', line 15

def merge(*hashes)
  hashes.inject({}, &:merge!)
end