class RuboCop::Cop::Style::SymbolProc
def on_block(node)
def on_block(node) block_send, block_args, block_body = *node _breceiver, bmethod_name, bargs = *block_send # TODO: Rails-specific handling that we should probably make # configurable - https://github.com/bbatsov/rubocop/issues/1485 # we should ignore lambdas & procs return if block_send == PROC_NODE return if [:lambda, :proc].include?(bmethod_name) return if ignored_method?(bmethod_name) # File.open(file) { |f| f.readlines } return if bargs return unless can_shorten?(block_args, block_body) _receiver, method_name, _args = *block_body add_offense(node, :expression, format(MSG, method_name, bmethod_name)) end