module RuboCop::Cop::Heredoc

Common functionality for working with heredoc strings.

Constants

OPENING_DELIMITER

Public Instance Methods

on_dstr(node)
Alias for: on_str
on_heredoc(_node) click to toggle source
# File lib/rubocop/cop/mixin/heredoc.rb, line 17
def on_heredoc(_node)
  raise NotImplementedError
end
on_str(node) click to toggle source
# File lib/rubocop/cop/mixin/heredoc.rb, line 9
def on_str(node)
  return unless node.heredoc?

  on_heredoc(node)
end
Also aliased as: on_dstr, on_xstr
on_xstr(node)
Alias for: on_str

Private Instance Methods

delimiter_string(node) click to toggle source
# File lib/rubocop/cop/mixin/heredoc.rb, line 23
def delimiter_string(node)
  node.source.match(OPENING_DELIMITER).captures[1]
end
heredoc_type(node) click to toggle source
# File lib/rubocop/cop/mixin/heredoc.rb, line 27
def heredoc_type(node)
  node.source.match(OPENING_DELIMITER).captures[0]
end