class RuboCop::Cop::Style::SymbolProc
def on_block(node)
def on_block(node) block_send_or_super, block_args, block_body = *node if super?(block_send_or_super) bmethod_name = :super else _breceiver, bmethod_name, _bargs = *block_send_or_super end # 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_or_super == PROC_NODE return if [:lambda, :proc].include?(bmethod_name) return if ignored_method?(bmethod_name) return unless can_shorten?(block_args, block_body) _receiver, method_name, _args = *block_body sb = node.source_range.source_buffer block_start = node.loc.begin.begin_pos block_end = node.loc.end.end_pos range = Parser::Source::Range.new(sb, block_start, block_end) add_offense(node, range, format(MSG, method_name, bmethod_name)) end