Class: DeRjs::JavaScriptProxy
- Inherits:
-
Object
- Object
- DeRjs::JavaScriptProxy
- Defined in:
- lib/de_rjs/jquery_generator.rb
Overview
:nodoc:
Direct Known Subclasses
JavaScriptCollectionProxy, JavaScriptElementProxy, JavaScriptVariableProxy
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(generator, root = nil) ⇒ JavaScriptProxy
constructor
A new instance of JavaScriptProxy.
- #is_a?(klass) ⇒ Boolean
Constructor Details
#initialize(generator, root = nil) ⇒ JavaScriptProxy
Returns a new instance of JavaScriptProxy.
574 575 576 577 |
# File 'lib/de_rjs/jquery_generator.rb', line 574 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
#method_missing(method, *arguments, &block) ⇒ Object (private)
588 589 590 591 592 593 594 595 596 |
# File 'lib/de_rjs/jquery_generator.rb', line 588 def method_missing(method, *arguments, &block) if method.to_s =~ /(.*)=$/ warn(method.to_s, *arguments) assign($1, arguments.first) else warn(method.to_s, *arguments) call("#{method.to_s.camelize(:lower)}", *arguments, &block) end end |
Instance Method Details
#==(other) ⇒ Object
583 584 585 |
# File 'lib/de_rjs/jquery_generator.rb', line 583 def ==(other) raise "haha" end |
#is_a?(klass) ⇒ Boolean
579 580 581 |
# File 'lib/de_rjs/jquery_generator.rb', line 579 def is_a?(klass) klass == JavaScriptProxy end |