Class: RuboCop::Cop::Sevgi::Parentheses
- Inherits:
-
Style::MethodCallWithArgsParentheses
- Object
- Style::MethodCallWithArgsParentheses
- RuboCop::Cop::Sevgi::Parentheses
- Defined in:
- lib/rubocop/cop/sevgi/parentheses.rb
Overview
Omits optional parentheses from bare DSL-shaped calls and capitalized Sevgi operations.
Ordinary Ruby calls with explicit receivers retain their normal style. The inherited RuboCop implementation still preserves parentheses where Ruby syntax or expression binding benefits from them.
Instance Method Summary collapse
-
#on_send(node) ⇒ void
(also: #on_csend)
Checks a method call when its shape belongs to the Sevgi drawing vocabulary.
Instance Method Details
#on_send(node) ⇒ void Also known as: on_csend
This method returns an undefined value.
Checks a method call when its shape belongs to the Sevgi drawing vocabulary.
17 18 19 20 21 |
# File 'lib/rubocop/cop/sevgi/parentheses.rb', line 17 def on_send(node) return if node.method_name.end_with?("?") super if node.receiver.nil? || node.method_name.match?(/\A[A-Z]/) end |