Checks for space between a the name of a called method and a left parenthesis.
@example
puts (x + y)
# File lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb, line 14 def on_send(node) _receiver, method_name, args = *node return if operator?(method_name) || method_name.to_s.end_with?('=') return unless args && args.loc.expression.source.start_with?('(') space_length = spaces_before_left_parenthesis(node) return unless space_length > 0 expr = args.loc.expression space_range = Parser::Source::Range.new(expr.source_buffer, expr.begin_pos - space_length, expr.begin_pos) add_offense(nil, space_range) end
Generated with the Darkfish Rdoc Generator 2.