Module: RuboCop::Cop::Heredoc

Overview

Common functionality for working with heredoc strings.

Constant Summary collapse

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

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