Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/bleak_house/support/core_extensions.rb
Instance Method Summary collapse
-
#slice(keys) ⇒ Object
Similar to the ActiveSupport methods in Rails.
- #unslice(keys) ⇒ Object
Instance Method Details
#slice(keys) ⇒ Object
Similar to the ActiveSupport methods in Rails
21 22 23 24 25 26 |
# File 'lib/bleak_house/support/core_extensions.rb', line 21 def slice(keys) keys = Set.new(keys) reject do |key,| !keys.include?(key) end end |
#unslice(keys) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/bleak_house/support/core_extensions.rb', line 28 def unslice(keys) keys = Set.new(keys) reject do |key,| keys.include?(key) end end |