Method: Hash#slice
- Defined in:
- lib/xqsr3/extensions/hash/slice.rb
#slice(*args) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/xqsr3/extensions/hash/slice.rb', line 6 def slice(*args) r = {} args.each do |arg| if self.has_key? arg r[arg] = self[arg] end end r end |