Class: RuboCop::Cop::Sumi::Parentheses
- Inherits:
-
Style::MethodCallWithArgsParentheses
- Object
- Style::MethodCallWithArgsParentheses
- RuboCop::Cop::Sumi::Parentheses
- Defined in:
- appendix/lib/rubocop/cop/sumi/parentheses.rb
Overview
Omits optional parentheses from bare DSL-shaped calls and capitalized Sumi 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 Sumi 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 Sumi drawing vocabulary.
17 18 19 20 21 |
# File 'appendix/lib/rubocop/cop/sumi/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 |