module Heredoc
Common functionality for working with heredoc strings.
Constants
- OPENING_DELIMITER
Public Instance Methods
on_heredoc(_node)
click to toggle source
# File lib/rubocop/cop/mixin/heredoc.rb, line 14 def on_heredoc(_node) raise NotImplementedError end
on_str(node)
click to toggle source
# File lib/rubocop/cop/mixin/heredoc.rb, line 6 def on_str(node) return unless heredoc?(node) on_heredoc(node) end
Private Instance Methods
delimiter_string(node)
click to toggle source
# File lib/rubocop/cop/mixin/heredoc.rb, line 24 def delimiter_string(node) node.source.match(OPENING_DELIMITER).captures.first end
heredoc?(node)
click to toggle source
# File lib/rubocop/cop/mixin/heredoc.rb, line 20 def heredoc?(node) node.loc.is_a?(Parser::Source::Map::Heredoc) end