Skip to content

Commit 8c8db14

Browse files
authored
Add Redis#with and Redis#then definitions (#961)
1 parent a63052d commit 8c8db14

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

gems/redis/4.2/_test/with.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
redis = Redis.new
2+
3+
redis.with do |conn|
4+
conn.set "foo", "bar"
5+
end
6+
# => "OK"

gems/redis/4.2/redis.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,6 @@ class Redis
276276
# @see #eval
277277
# @see #evalsha
278278
def script: (Symbol, *untyped) -> untyped
279+
280+
def with: [T] () { (self) -> T } -> T
279281
end

0 commit comments

Comments
 (0)