Weird Ruby: Positive and Negative Strings
And here we are:
Turns out that when frozen string literals were introduced in Ruby 2.3 a couple of unary methods were added to the class – namely unary and . Here’s its description from the official API docs:
And here are a few examples:
Generally, I don’t think you’ll find any use for it if you’re leveraging the pragma, but it’s an useful shorthand to freeze a string otherwise. A word of caution – the positive and negative string literals result in code that’s pretty weird, so you should use them sparingly.
Source: metaredux.com