Required files
- set
- will_paginate/array
Public instance methods
except
(*keys)
Returns a new hash without the given keys.
[show source]
# File lib/will_paginate/core_ext.rb, line 18 def except(*keys) rejected = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys) reject { |key,| rejected.include?(key) } end
except!
(*keys)
Replaces the hash without only the given keys.
[show source]
# File lib/will_paginate/core_ext.rb, line 24 def except!(*keys) replace(except(*keys)) end
slice
(*keys)
Returns a new hash with only the given keys.
[show source]
# File lib/will_paginate/core_ext.rb, line 33 def slice(*keys) allowed = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys) reject { |key,| !allowed.include?(key) } end
slice!
(*keys)
Replaces the hash with only the given keys.
[show source]
# File lib/will_paginate/core_ext.rb, line 39 def slice!(*keys) replace(slice(*keys)) end