Returns an object whose to_json evaluates to code. Use this to pass a literal JavaScript expression as an argument to another JavaScriptGenerator method.
Examples:
"function() { alert('test') }".to_l
Methods
Public Instance methods
Alias for to_literal
Returns an object whose to_json evaluates to code. Use this to pass a literal JavaScript expression as an argument to another JavaScriptGenerator method.
This method is also aliased as
to_l
[ show source ]
# File lib/utils/literal.rb, line 14
14: def to_literal
15: ActiveSupport::JSON::Variable.new(self.to_s)
16: end