This cop checks for interpolated literals.
@example
"result is #{10}"
# File lib/rubocop/cop/lint/literal_in_interpolation.rb, line 16 def on_dstr(node) node.children.select { |n| n.type == :begin }.each do |begin_node| final_node = begin_node.children.last next unless final_node # handle strings like __FILE__ return if special_string?(final_node) next unless LITERALS.include?(final_node.type) add_offense(final_node, :expression) end end
Generated with the Darkfish Rdoc Generator 2.