We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c72e8dc commit b659378Copy full SHA for b659378
README.adoc
@@ -4910,6 +4910,20 @@ message = "This is the #{result.to_s}."
4910
message = "This is the #{result}."
4911
----
4912
4913
+=== Empty Strings In Interpolation [[empty-strings-in-interpolation]]
4914
+
4915
+Don't assign empty strings inside string interpolation.
4916
+For conditionals, use modifier statements instead of ternaries with empty strings.
4917
4918
+[source,ruby]
4919
+----
4920
+# bad
4921
+"#{condition ? 'foo' : ''}"
4922
4923
+# good
4924
+"#{'foo' if condition}"
4925
4926
4927
=== String Concatenation [[concat-strings]]
4928
4929
Avoid using `pass:[String#+]` when you need to construct large data chunks.
0 commit comments