Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/awesome_nested_set/compatability.rb

Overview

Rails <2.x doesn’t define #except

Instance Method Summary collapse

Instance Method Details

#except!(*keys) ⇒ Object

Replaces the hash without the given keys.



9
10
11
12
13
# File 'lib/awesome_nested_set/compatability.rb', line 9

def except!(*keys)
  keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
  keys.each { |key| delete(key) }
  self
end