Module: RuboCop::Cop::Interpolation Abstract

Overview

This module is abstract.

Subclasses are expected to implement #on_interpolation.

Common functionality for working with string interpolations.

Instance Method Summary collapse

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 21

#on_node_with_interpolations(node) ⇒ Object



17
18
19
# File 'lib/rubocop/cop/mixin/interpolation.rb', line 17

def on_node_with_interpolations(node)
  node.each_child_node(:begin) { |begin_node| on_interpolation(begin_node) }
end