Inspectopedia Help

Interpolated variable without braces

Reports interpolated variables (instance or global) without braces in expression substitutions.

Example:

# Bad practice @name = 'John Doe' puts "Hi #@name"

A quick-fix is available to insert the missing braces. After the quick-fix is applied, the result looks like this:

# Good practice @name = 'John Doe' puts "Hi #{@name}"

Inspection Details

Available in:

Qodana for Ruby 2023.3, RubyMine 2023.3

Plugin:

Ruby, 233.SNAPSHOT

Last modified: 13 July 2023