Ejemplo n.º 1
0
        internal static RString New(NetRuby rb, object[] args)
        {
            RString rs = new RString(rb, String.Empty);

            rb.CallInit(rs, args);
            return(rs);
        }
Ejemplo n.º 2
0
        static public RBasic NewThreadGroup(object[] argv, RMetaObject meta)
        {
            NetRuby      ruby = meta.ruby;
            RThreadGroup tg   = new RThreadGroup(ruby, meta);

            ruby.CallInit(tg, argv);
            return(tg);
        }
Ejemplo n.º 3
0
        static public RBasic NewThread(object[] argv, RMetaObject meta)
        {
            NetRuby ruby   = meta.ruby;
            RThread parent = ruby.GetCurrentContext();
            RThread thrd   = (RThread)parent.Clone();

            thrd.thread = null;
            thrd.klass  = meta;
            ruby.CallInit(thrd, argv);
            return(thrd);
        }
Ejemplo n.º 4
0
        static public RBasic NewInstance(object[] argv, RMetaObject meta)
        {
            if (meta is RSingletonClass)
            {
                throw new eTypeError("can't create instance of virtual class");
            }
            NetRuby ruby = meta.ruby;
            RObject obj  = new RObject(ruby, meta);

            ruby.CallInit(obj, argv);
            return(obj);
        }
Ejemplo n.º 5
0
        internal static object s_new(RBasic r, params object[] args)
        {
            NetRuby rb = r.ruby;
            RArray  a  = new RArray(rb, false, (RMetaObject)r);

            rb.CallInit(a, args);
            if (a.ptr == null)
            {
                a.ptr = new ArrayList();
            }
            return(a);
        }
Ejemplo n.º 6
0
        static public RClass ClassNew(NetRuby ruby, RMetaObject spr, object[] o)
        {
            if (spr == null)
            {
                spr = ruby.cObject;
            }
            else if (spr is RSingletonClass)
            {
                throw new eTypeError("can't make subclass of virtual class");
            }
            RClass klass = new RClass(ruby, spr);

            klass.klass = new RSingletonClass(spr.klass);
            klass.klass.AttachSingleton(klass);
            ruby.CallInit(klass, o);
            ruby.Funcall(spr, "inherited", new object[1] {
                klass
            });
            return(klass);
        }