File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,7 @@ def on_block(node)
27
27
autocorrect ( corrector , node )
28
28
end
29
29
end
30
-
31
- def on_numblock ( node )
32
- return unless match_redundant_around_hook_numblock? ( node )
33
-
34
- add_offense ( node ) do |corrector |
35
- autocorrect ( corrector , node )
36
- end
37
- end
30
+ alias on_numblock on_block
38
31
39
32
def on_send ( node )
40
33
return unless match_redundant_around_hook_send? ( node )
@@ -48,16 +41,7 @@ def on_send(node)
48
41
49
42
# @!method match_redundant_around_hook_block?(node)
50
43
def_node_matcher :match_redundant_around_hook_block? , <<~PATTERN
51
- (block
52
- (send _ :around ...)
53
- (args _?)
54
- (send _ :run)
55
- )
56
- PATTERN
57
-
58
- # @!method match_redundant_around_hook_numblock?(node)
59
- def_node_matcher :match_redundant_around_hook_numblock? , <<~PATTERN
60
- (numblock (send _ :around) ... (send _ :run))
44
+ ({block numblock} (send _ :around ...) ... (send _ :run))
61
45
PATTERN
62
46
63
47
# @!method match_redundant_around_hook_send?(node)
You can’t perform that action at this time.
0 commit comments