Package org.jruby

Examples of org.jruby.RubyModule.callMethod()


        RubyModule module = context.getRubyClass();
  
        if (module == null) throw runtime.newTypeError("no class to make alias");
  
        module.defineAlias(newName, oldName);
        module.callMethod(context, "method_added", runtime.newSymbol(newName));
  
        return runtime.getNil();
    }
   
    public static IRubyObject negate(IRubyObject value, Ruby runtime) {
View Full Code Here


  
        if (context.getCurrentVisibility() == Visibility.MODULE_FUNCTION) {
            containingClass.getSingletonClass().addMethod(name,
                    new WrapperMethod(containingClass.getSingletonClass(), newMethod, Visibility.PUBLIC));
           
            containingClass.callMethod(context, "singleton_method_added", runtime.fastNewSymbol(name));
        }
  
        // 'class << state.self' and 'class << obj' uses defn as opposed to defs
        if (containingClass.isSingleton()) {
            ((MetaClass) containingClass).getAttached().callMethod(context,
View Full Code Here

        // 'class << state.self' and 'class << obj' uses defn as opposed to defs
        if (containingClass.isSingleton()) {
            ((MetaClass) containingClass).getAttached().callMethod(context,
                    "singleton_method_added", runtime.fastNewSymbol(name));
        } else {
            containingClass.callMethod(context, "method_added", runtime.fastNewSymbol(name));
        }
  
        return runtime.getNil();       
    }
}
View Full Code Here

                }

                rubyObj = unmarshalObject();
               
                tp.extend_object(rubyObj);
                tp.callMethod(runtime.getCurrentContext(),"extended", rubyObj);
                break;
            case 'l' :
                rubyObj = RubyBignum.unmarshalFrom(this);
                break;
            case 'S' :
View Full Code Here

        RubyString data = RubyString.newString(getRuntime(), marshaled);
        if (ivarsWaiting) {
            defaultVariablesUnmarshal(data);
            ivarsWaiting = false;
        }
        IRubyObject result = classInstance.callMethod(getRuntime().getCurrentContext(),
            "_load", data);
        registerLinkTarget(result);
        return result;
    }
View Full Code Here

                if (context.getCurrentVisibility() == Visibility.MODULE_FUNCTION) {
                    clzz.getSingletonClass().addMethod(
                            name,
                            new WrapperMethod(clzz.getSingletonClass(), newMethod,
                                    Visibility.PUBLIC));
                    clzz.callMethod(context, "singleton_method_added", literals[val]);
                }
   
                if (clzz.isSingleton()) {
                    ((MetaClass) clzz).getAttached().callMethod(
                            context, "singleton_method_added", literals[val]);
View Full Code Here

   
                if (clzz.isSingleton()) {
                    ((MetaClass) clzz).getAttached().callMethod(
                            context, "singleton_method_added", literals[val]);
                } else {
                    clzz.callMethod(context, "method_added", literals[val]);
                }
                stack[++stackTop] = method;
                break;
            }
            case RubiniusInstructions.META_PUSH_NEG_1: {
View Full Code Here

        return RuntimeHelpers.invoke(context, this, "match_for_buffer", buffer, runtime.getTrue());
      }
      return callMethod(context, "match_for_buffer", buffer);
    } else if (m.hitEnd()) {
      RubyModule potential_match = runtime.getClassFromPath("RubySpeech::GRXML::PotentialMatch");
      return potential_match.callMethod(context, "new");
    }
    RubyModule nomatch = runtime.getClassFromPath("RubySpeech::GRXML::NoMatch");
    return nomatch.callMethod(context, "new");
  }
View Full Code Here

    } else if (m.hitEnd()) {
      RubyModule potential_match = runtime.getClassFromPath("RubySpeech::GRXML::PotentialMatch");
      return potential_match.callMethod(context, "new");
    }
    RubyModule nomatch = runtime.getClassFromPath("RubySpeech::GRXML::NoMatch");
    return nomatch.callMethod(context, "new");
  }

  public Boolean is_max_match(String buffer)
  {
    String search_set = "0123456789#*ABCD";
 
View Full Code Here

                }

                rubyObj = unmarshalObject();

                tp.extend_object(rubyObj);
                tp.callMethod(runtime.getCurrentContext(),"extended", rubyObj);
                break;
            case 'l' :
                rubyObj = RubyBignum.unmarshalFrom(this);
                break;
            case 'S' :
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.