Class: RuboCop::Cop::Performance::MethodObjectAsBlock
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Base
|
|
Instance Chain:
self,
Base
|
|
Inherits: |
Base
|
Defined in: | lib/rubocop/cop/performance/method_object_as_block.rb |
Overview
Identifies places where methods are converted to blocks, with the
use of &method
, and passed as arguments to method calls.
It is faster to replace those with explicit blocks, calling those methods inside.
Constant Summary
-
MSG =
# File 'lib/rubocop/cop/performance/method_object_as_block.rb', line 20'Use block explicitly instead of block-passing a method object.'
Instance Method Summary
Instance Method Details
#on_block_pass(node)
[ GitHub ]# File 'lib/rubocop/cop/performance/method_object_as_block.rb', line 26
def on_block_pass(node) add_offense(node) if method_object_as_argument?(node) end