vendor/plugins/ym4r-gm/lib/gm_plugin/mapping.rb
#Creates javascript code for missing methods + takes care of listeners

Creates javascript code for missing methods + takes care of listeners
Creates javascript code for missing methods + takes care of listeners
def method_missing(name,*args)
        str_name = name.to_s
        if str_name =~ /^on_(.*)/
          if args.length != 1
            raise ArgumentError("Only 1 argument is allowed on on_ methods");
          else
            Variable.new("GEvent.addListener(#{to_javascript},\"#{MappingObject.javascriptify_method($1)}\",#{args[0]})")
          end
        else
          args.collect! do |arg|
            MappingObject.javascriptify_variable(arg)
          end
          Variable.new("#{to_javascript}.#{MappingObject.javascriptify_method(str_name)}(#{args.join(",")})")
        end
      end
def method_missing ( name , * args ) str_name = name . to_s if str_name =~ / ^on_(.*) / if args . length != 1 raise ArgumentError ( "Only 1 argument is allowed on on_ methods" ) ; else Variable . new ( "GEvent.addListener(#{to_javascript},\"#{MappingObject.javascriptify_method($1)}\",#{args[0]})" ) end else args . collect! do | arg | MappingObject . javascriptify_variable ( arg ) end Variable . new ( "#{to_javascript}.#{MappingObject.javascriptify_method(str_name)}(#{args.join(",")})" ) end end
Creates javascript code for missing methods + takes care of listeners
Creates javascript code for missing methods + takes care of listeners
name
<not_specific>
args
<not_specific>