mirror of
https://github.com/samsonjs/stormy-weather.git
synced 2026-03-25 09:15:57 +00:00
12 lines
174 B
Ruby
12 lines
174 B
Ruby
# Copyright 2012 Sami Samhuri <sami@samhuri.net>
|
|
|
|
class Hash
|
|
|
|
def slice(*keys)
|
|
keys.inject({}) do |h, k|
|
|
h[k] = self[k] if has_key?(k)
|
|
h
|
|
end
|
|
end
|
|
|
|
end
|