123456789_123456789_123456789_123456789_123456789_

Module: RuboCop::Cop::Parentheses

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/rubocop/cop/mixin/parentheses.rb

Overview

Common functionality for handling parentheses.

Instance Method Summary

Instance Method Details

#parens_required?(node) ⇒ Boolean (private)

[ GitHub ]

  
# File 'lib/rubocop/cop/mixin/parentheses.rb', line 9

def parens_required?(node)
  range  = node.source_range
  source = range.source_buffer.source
  /[a-z]/.match?(source[range.begin_pos - 1]) || /[a-z]/.match?(source[range.end_pos])
end