Hash: select entries by keys

This commit is contained in:
Karl Erik Õunapuu 2021-01-07 13:59:12 +02:00
parent c23075fa19
commit c58b4fb2e9
No known key found for this signature in database
GPG key ID: C9DD647298A34764
11 changed files with 201 additions and 141 deletions

View file

@ -0,0 +1,5 @@
class Hash
def select_keys(*args)
select { |k, _| args.include?(k) }.map { |_k, v| v }
end
end