Reputation: 117
This doesn't work:
FOOBAR = 'foobar'
%W{ FOOBAR }
output: ["FOOBAR"]
However, the constant gets interpolated correctly by:
"#{FOOBAR}"
output: "foobar"
Upvotes: 2
Views: 688
Reputation: 51151
You're misusing %W
literal. From book:
%W - Interpolated Array of words, separated by whitespace
so it doesn't have anything to do with interpolation.
Upvotes: 5