Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Thor::CoreExt::HashWithIndifferentAccess#slice method #812

Merged
merged 3 commits into from
May 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Support HashWithIndifferentAccess#slice
  • Loading branch information
shuuuuun authored and rafaelfranca committed May 15, 2023
commit 0029b0d24126f53fa27fa58f3f15d07605363878
4 changes: 4 additions & 0 deletions lib/thor/core_ext/hash_with_indifferent_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ def fetch(key, *args)
super(convert_key(key), *args)
end

def slice(*keys)
super(*keys.map{ convert_key(_1) })
end

def key?(key)
super(convert_key(key))
end
Expand Down