Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- vendor/plugins/awesome_nested_set/lib/awesome_nested_set/compatability.rb
Overview
Rails <2.x doesn’t define #except
Direct Known Subclasses
Instance Method Summary
-
- (Object) except(*keys)
Returns a new hash without the given keys.
-
- (Object) except!(*keys)
Replaces the hash without the given keys.
Instance Method Details
- (Object) except(*keys)
Returns a new hash without the given keys.
4 5 6 |
# File 'vendor/plugins/awesome_nested_set/lib/awesome_nested_set/compatability.rb', line 4 def except(*keys) clone.except!(*keys) end unless method_defined?(:except) |
- (Object) except!(*keys)
Replaces the hash without the given keys.
9 10 11 12 13 |
# File 'vendor/plugins/awesome_nested_set/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 unless method_defined?(:except!) |