Class: ActionView::Helpers::JavaScriptProxy
- Inherits:
- ActiveSupport::BasicObject
- Defined in:
- actionpack/lib/action_view/helpers/prototype_helper.rb
Overview
Converts chained method calls on DOM proxy elements into JavaScript chains
Instance Method Summary (collapse)
-
- (JavaScriptProxy) initialize(generator, root = nil)
constructor
:nodoc:.
- - (Boolean) is_a?(klass)
Methods inherited from ActiveSupport::BasicObject
Constructor Details
- (JavaScriptProxy) initialize(generator, root = nil)
:nodoc:
651 652 653 654 |
# File 'actionpack/lib/action_view/helpers/prototype_helper.rb', line 651 def initialize(generator, root = nil) @generator = generator @generator << root if root end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(method, *arguments, &block) (private)
661 662 663 664 665 666 667 |
# File 'actionpack/lib/action_view/helpers/prototype_helper.rb', line 661 def method_missing(method, *arguments, &block) if method.to_s =~ /(.*)=$/ assign($1, arguments.first) else call("#{method.to_s.camelize(:lower)}", *arguments, &block) end end |
Instance Method Details
- (Boolean) is_a?(klass)
656 657 658 |
# File 'actionpack/lib/action_view/helpers/prototype_helper.rb', line 656 def is_a?(klass) klass == JavaScriptProxy end |