Skip to content

Instantly share code, notes, and snippets.

@YoshitsuguFujii
Created December 27, 2012 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YoshitsuguFujii/4386691 to your computer and use it in GitHub Desktop.
Save YoshitsuguFujii/4386691 to your computer and use it in GitHub Desktop.
module ExtendBuiltInDataType
class ::Hash
def merge_apend_value(hash) #{{{
self.update(hash) do |key, self_val, other_val|
Array.wrap(self_val).push(other_val)
end
end #}}}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment