class Hash

Public Instance Methods

except(*keys) click to toggle source
# File lib/manifestly/utilities.rb, line 11
def except(*keys)
  dup.except!(*keys)
end
except!(*keys) click to toggle source
# File lib/manifestly/utilities.rb, line 6
def except!(*keys)
  keys.each { |key| delete(key) }
  self
end
get_deep(*fields) click to toggle source
# File lib/manifestly/utilities.rb, line 2
def get_deep(*fields)
  fields.inject(self) {|acc,e| acc[e] if acc}
end
slice(*keys) click to toggle source
# File lib/manifestly/utilities.rb, line 15
def slice(*keys)
  keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true)
  keys.each_with_object(self.class.new) { |k, hash| hash[k] = self[k] if has_key?(k) }
end