class Hash
Public Instance Methods
deep_merge(other_hash)
click to toggle source
# File lib/flickrie/core_ext.rb, line 10 def deep_merge(other_hash) dup.deep_merge!(other_hash) end
deep_merge!(other_hash)
click to toggle source
# File lib/flickrie/core_ext.rb, line 2 def deep_merge!(other_hash) other_hash.each_pair do |k,v| tv = self[k] self[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? tv.deep_merge(v) : v end self end
except(*keys)
click to toggle source
# File lib/flickrie/core_ext.rb, line 19 def except(*keys) self.dup.except!(*keys) end
except!(*keys)
click to toggle source
# File lib/flickrie/core_ext.rb, line 14 def except!(*keys) keys.each { |key| delete(key) } self end