File tree Expand file tree Collapse file tree 4 files changed +27
-27
lines changed Expand file tree Collapse file tree 4 files changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,16 @@ class Kredis::Types::Counter < Kredis::Types::Proxying
44 attr_accessor :expires_in
55
66 def increment ( by : 1 )
7- multi do | pipeline |
8- pipeline . set 0 , ex : expires_in , nx : true
9- pipeline . incrby by
7+ multi do
8+ set 0 , ex : expires_in , nx : true
9+ incrby by
1010 end [ -1 ]
1111 end
1212
1313 def decrement ( by : 1 )
14- multi do | pipeline |
15- pipeline . set 0 , ex : expires_in , nx : true
16- pipeline . decrby by
14+ multi do
15+ set 0 , ex : expires_in , nx : true
16+ decrby by
1717 end [ -1 ]
1818 end
1919
Original file line number Diff line number Diff line change @@ -8,16 +8,16 @@ def elements
88 end
99 alias to_a elements
1010
11- def remove ( *elements , pipeline : nil )
12- types_to_strings ( elements , typed ) . each { |element | ( pipeline || proxy ) . lrem 0 , element }
11+ def remove ( *elements )
12+ types_to_strings ( elements , typed ) . each { |element | lrem 0 , element }
1313 end
1414
15- def prepend ( *elements , pipeline : nil )
16- ( pipeline || proxy ) . lpush types_to_strings ( elements , typed ) if elements . flatten . any?
15+ def prepend ( *elements )
16+ lpush types_to_strings ( elements , typed ) if elements . flatten . any?
1717 end
1818
19- def append ( *elements , pipeline : nil )
20- ( pipeline || proxy ) . rpush types_to_strings ( elements , typed ) if elements . flatten . any?
19+ def append ( *elements )
20+ rpush types_to_strings ( elements , typed ) if elements . flatten . any?
2121 end
2222 alias << append
2323
Original file line number Diff line number Diff line change @@ -8,19 +8,19 @@ def members
88 end
99 alias to_a members
1010
11- def add ( *members , pipeline : nil )
12- ( pipeline || proxy ) . sadd types_to_strings ( members , typed ) if members . flatten . any?
11+ def add ( *members )
12+ sadd types_to_strings ( members , typed ) if members . flatten . any?
1313 end
1414 alias << add
1515
16- def remove ( *members , pipeline : nil )
17- ( pipeline || proxy ) . srem types_to_strings ( members , typed ) if members . flatten . any?
16+ def remove ( *members )
17+ srem types_to_strings ( members , typed ) if members . flatten . any?
1818 end
1919
2020 def replace ( *members )
21- multi do | pipeline |
22- pipeline . del
23- add members , pipeline : pipeline
21+ multi do
22+ del
23+ add members
2424 end
2525 end
2626
Original file line number Diff line number Diff line change @@ -8,21 +8,21 @@ def prepend(elements)
88 elements = Array ( elements ) . uniq
99 return if elements . empty?
1010
11- multi do | pipeline |
12- remove elements , pipeline : pipeline
13- super ( elements , pipeline : pipeline )
14- pipeline . ltrim 0 , ( limit - 1 ) if limit
11+ multi do
12+ remove elements
13+ super
14+ ltrim 0 , ( limit - 1 ) if limit
1515 end
1616 end
1717
1818 def append ( elements )
1919 elements = Array ( elements ) . uniq
2020 return if elements . empty?
2121
22- multi do | pipeline |
23- remove elements , pipeline : pipeline
24- super ( elements , pipeline : pipeline )
25- pipeline . ltrim -limit , -1 if limit
22+ multi do
23+ remove elements
24+ super
25+ ltrim -limit , -1 if limit
2626 end
2727 end
2828 alias << append
You can’t perform that action at this time.
0 commit comments