mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 12:47:29 +02:00
Hash: select entries by keys
This commit is contained in:
parent
c23075fa19
commit
c58b4fb2e9
11 changed files with 201 additions and 141 deletions
5
lib/core_monkey_patches/hash.rb
Normal file
5
lib/core_monkey_patches/hash.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Hash
|
||||
def select_keys(*args)
|
||||
select { |k, _| args.include?(k) }.map { |_k, v| v }
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue