Module: Heredoc

Overview

Common functionality for working with heredoc strings.

Constant Summary collapse

OPENING_DELIMITER =
/<<[~-]?'?(\w+)'?\b/

Instance Method Summary collapse

Instance Method Details

#on_heredoc(_node) ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/rubocop/cop/mixin/heredoc.rb', line 15

def on_heredoc(_node)
  raise NotImplementedError
end

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



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

def on_str(node)
  return unless heredoc?(node)

  on_heredoc(node)
end