Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/theoldreader/core_ext/hash.rb
Instance Method Summary collapse
Instance Method Details
#slice(*keys) ⇒ Object
2 3 4 5 |
# File 'lib/theoldreader/core_ext/hash.rb', line 2 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 |