Class: ActiveSupport::JS::Code
- Defined in:
- lib/to-javascript/code.rb
Overview
A string that returns itself as Javascript code.
Instance Method Summary collapse
-
#initialize(object) ⇒ Code
constructor
A new instance of Code.
-
#to_js(options = nil) ⇒ Object
Returns an unquoted string to be exectuted as Javacript code.
Methods inherited from String
Constructor Details
Instance Method Details
#to_js(options = nil) ⇒ Object
Returns an unquoted string to be exectuted as Javacript code
{ :location => 'window.location'.as_js }.to_js
# => {"location": window.location}
33 34 35 |
# File 'lib/to-javascript/code.rb', line 33 def to_js(=nil) self end |