Module: RuboCop::Cop::Interpolation Abstract
- Included in:
- Layout::SpaceInsideStringInterpolation, Lint::EmptyInterpolation, Lint::LiteralInInterpolation, Lint::RedundantStringCoercion, Style::VariableInterpolation
- Defined in:
- lib/rubocop/cop/mixin/interpolation.rb
Overview
This module is abstract.
Subclasses are expected to implement #on_interpolation.
Common functionality for working with string interpolations.
Instance Method Summary collapse
- #on_dstr(node) ⇒ Object (also: #on_xstr, #on_dsym, #on_regexp)
-
#on_interpolation(begin_node) ⇒ Object
Inspect the ‘:begin` node of an interpolation.
- #on_node_with_interpolations(node) ⇒ Object
Instance Method Details
#on_dstr(node) ⇒ Object Also known as: on_xstr, on_dsym, on_regexp
9 10 11 |
# File 'lib/rubocop/cop/mixin/interpolation.rb', line 9 def on_dstr(node) on_node_with_interpolations(node) end |
#on_interpolation(begin_node) ⇒ Object
Inspect the ‘:begin` node of an interpolation
|
# File 'lib/rubocop/cop/mixin/interpolation.rb', line 23
|
#on_node_with_interpolations(node) ⇒ Object
17 18 19 20 21 |
# File 'lib/rubocop/cop/mixin/interpolation.rb', line 17 def on_node_with_interpolations(node) node.each_child_node(:begin) do |begin_node| on_interpolation(begin_node) end end |