Class: DeRjs::JavaScriptProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/de_rjs/jquery_generator.rb

Overview

:nodoc:

Instance Method Summary collapse

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

Returns:

  • (Boolean)


579
580
581
# File 'lib/de_rjs/jquery_generator.rb', line 579

def is_a?(klass)
  klass == JavaScriptProxy
end