Skip to content

Commit

Permalink
Add Hash#except for Ruby 3 (sorbet#5333)
Browse files Browse the repository at this point in the history
  • Loading branch information
swiknaba authored Feb 21, 2022
1 parent d2c97f0 commit 9dc1321
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rbi/core/hash.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,21 @@ class Hash < Object
# ```
def fetch_values(*_); end

# Returns a new Hash excluding entries for the given keys.
# [`Hash#except`](https://ruby-doc.org/core-3.0.0/Hash.html#method-i-except)
#
# ```ruby
# h = { a: 100, b: 200, c: 300 }
# h.except(:a) #=> {:b=>200, :c=>300}
# ```
sig do
params(
args: K,
)
.returns(T::Hash[K, V])
end
def except(*args); end

# Returns a new array that is a one-dimensional flattening of this hash. That
# is, for every key or value that is an array, extract its elements into the
# new array. Unlike
Expand Down

0 comments on commit 9dc1321

Please sign in to comment.