Module: Heredoc
- Included in:
- RuboCop::Cop::Layout::IndentHeredoc, RuboCop::Cop::Naming::HeredocDelimiterCase, RuboCop::Cop::Naming::HeredocDelimiterNaming
- Defined in:
- lib/rubocop/cop/mixin/heredoc.rb
Overview
Common functionality for working with heredoc strings.
Constant Summary collapse
- OPENING_DELIMITER =
/<<[~-]?'?(\w+)'?\b/
Instance Method Summary collapse
- #on_heredoc(_node) ⇒ Object
- #on_str(node) ⇒ Object (also: #on_dstr, #on_xstr)
Instance Method Details
#on_heredoc(_node) ⇒ Object
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 |