Class: ActionView::Helpers::JavaScriptVariableProxy
- Inherits:
-
JavaScriptProxy
- Object
- ActiveSupport::BasicObject
- JavaScriptProxy
- ActionView::Helpers::JavaScriptVariableProxy
- Defined in:
- actionpack/lib/action_view/helpers/prototype_helper.rb
Overview
:nodoc:
Instance Method Summary (collapse)
- - (Object) as_json(options = nil)
-
- (JavaScriptVariableProxy) initialize(generator, variable)
constructor
A new instance of JavaScriptVariableProxy.
-
- (Boolean) respond_to?
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
Methods inherited from ActiveSupport::BasicObject
Constructor Details
- (JavaScriptVariableProxy) initialize(generator, variable)
A new instance of JavaScriptVariableProxy
725 726 727 728 729 |
# File 'actionpack/lib/action_view/helpers/prototype_helper.rb', line 725 def initialize(generator, variable) @variable = ::ActiveSupport::JSON::Variable.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 ActionView::Helpers::JavaScriptProxy
Instance Method Details
- (Object) as_json(options = nil)
737 738 739 |
# File 'actionpack/lib/action_view/helpers/prototype_helper.rb', line 737 def as_json( = nil) @variable end |
- (Boolean) respond_to?
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.
733 734 735 |
# File 'actionpack/lib/action_view/helpers/prototype_helper.rb', line 733 def respond_to?(*) true end |