Module: RuboCop::Cop::Heredoc
- Included in:
- Layout::ClosingHeredocIndentation, 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 =
/(<<[~-]?)['"`]?([^'"`]+)['"`]?/.freeze
Instance Method Summary collapse
- #on_heredoc(_node) ⇒ Object
- #on_str(node) ⇒ Object (also: #on_dstr, #on_xstr)
Instance Method Details
#on_heredoc(_node) ⇒ Object
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 |