class RuboCop::Cop::Lint::EmptyInterpolation

This cop checks for empty interpolation.

@example

"result is #{}"

Constants

MSG

Public Instance Methods

on_dstr(node) click to toggle source
# File lib/rubocop/cop/lint/empty_interpolation.rb, line 14
def on_dstr(node)
  node.children.select { |n| n.type == :begin }.each do |begin_node|
    add_offense(begin_node, :expression) if begin_node.children.empty?
  end
end