Class: DeRjs::JavaScriptVariableProxy
- Inherits:
-
JavaScriptProxy
- Object
- JavaScriptProxy
- DeRjs::JavaScriptVariableProxy
- Defined in:
- lib/de_rjs/jquery_generator.rb
Overview
:nodoc:
Instance Method Summary collapse
- #as_json(options = nil) ⇒ Object
-
#initialize(generator, variable) ⇒ JavaScriptVariableProxy
constructor
A new instance of JavaScriptVariableProxy.
-
#respond_to? ⇒ Boolean
The JSON Encoder calls this to check for the
to_json
method Since it’s a blank slate object, I suppose it responds to anything.
Methods inherited from JavaScriptProxy
Constructor Details
#initialize(generator, variable) ⇒ JavaScriptVariableProxy
Returns a new instance of JavaScriptVariableProxy.
683 684 685 686 687 |
# File 'lib/de_rjs/jquery_generator.rb', line 683 def initialize(generator, variable) @variable = JsonLiteral.new(variable) @empty = true # only record lines if we have to. gets rid of unnecessary linebreaks super(generator) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class DeRjs::JavaScriptProxy
Instance Method Details
#as_json(options = nil) ⇒ Object
695 696 697 |
# File 'lib/de_rjs/jquery_generator.rb', line 695 def as_json( = nil) @variable end |
#respond_to? ⇒ Boolean
The JSON Encoder calls this to check for the to_json
method Since it’s a blank slate object, I suppose it responds to anything.
691 692 693 |
# File 'lib/de_rjs/jquery_generator.rb', line 691 def respond_to?(*) true end |