Module: RuboCop::Cop::Heredoc

Included in:
Layout::IndentHeredoc, Naming::HeredocDelimiterCase, Naming::HeredocDelimiterNaming
Defined in:
lib/rubocop/cop/mixin/heredoc.rb

Overview

Common functionality for working with heredoc strings.

Constant Summary collapse

OPENING_DELIMITER =
/<<[~-]?['"`]?([^'"`]+)['"`]?/

Instance Method Summary collapse

Instance Method Details

#on_heredoc(_node) ⇒ Object

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/rubocop/cop/mixin/heredoc.rb', line 17

def on_heredoc(_node)
  raise NotImplementedError
end

#on_str(node) ⇒ Object Also known as: on_dstr, on_xstr



9
10
11
12
13
# File 'lib/rubocop/cop/mixin/heredoc.rb', line 9

def on_str(node)
  return unless node.heredoc?

  on_heredoc(node)
end