当前位置: 首页>>代码示例>>C#>>正文


C# Builtins.RubyClass类代码示例

本文整理汇总了C#中IronRuby.Builtins.RubyClass的典型用法代码示例。如果您正苦于以下问题:C# RubyClass类的具体用法?C# RubyClass怎么用?C# RubyClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RubyClass类属于IronRuby.Builtins命名空间,在下文中一共展示了RubyClass类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DefineGlobalClass

        protected RubyClass/*!*/ DefineGlobalClass(string/*!*/ name, Type/*!*/ type, RubyClass/*!*/ super, 
            Action<RubyModule> instanceTrait, Action<RubyModule> classTrait, RubyModule[]/*!*/ mixins, Delegate[] factories) {

            RubyClass result = _context.DefineLibraryClass(name, type, instanceTrait, classTrait, super, mixins, factories, _builtin);
            _context.ObjectClass.SetConstant(result.Name, result);
            return result;
        }
开发者ID:mscottford,项目名称:ironruby,代码行数:7,代码来源:Initializer.cs

示例2: Subclass

 public Subclass(RubyClass/*!*/ rubyClass, MutableString begin, MutableString end, bool excludeEnd)
     : base(begin, end, excludeEnd)
 {
     Assert.NotNull(rubyClass);
     Debug.Assert(!rubyClass.IsSingletonClass);
     ImmediateClass = rubyClass;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:Range.Subclass.cs

示例3: Subclass

 // called by Proc#new rule when creating a Ruby subclass of Proc:
 public Subclass(RubyClass/*!*/ rubyClass, Proc/*!*/ proc)
     : base(proc)
 {
     Assert.NotNull(rubyClass);
     Debug.Assert(!rubyClass.IsSingletonClass);
     ImmediateClass = rubyClass;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:Proc.Subclass.cs

示例4: Convert

        public static MutableString/*!*/ Convert(RubyClass/*!*/ self, 
            [DefaultProtocol]MutableString/*!*/ toEncoding, [DefaultProtocol]MutableString/*!*/ fromEncoding, 
            [DefaultProtocol]MutableString/*!*/ str) {

            //return iconv(to, from, str).join;
            return null;
        }
开发者ID:jxnmaomao,项目名称:ironruby,代码行数:7,代码来源:Iconv.cs

示例5: CreateHash

 public static Hash CreateHash(BlockParam block, RubyClass/*!*/ self, object defaultValue)
 {
     if (block != null) {
         throw RubyExceptions.CreateArgumentError("wrong number of arguments");
     }
     return new Hash(self.Context.EqualityComparer, null, defaultValue);
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:HashOps.cs

示例6: Create

        public static char Create(RubyClass/*!*/ self, [DefaultProtocol]MutableString/*!*/ str) {
            if (str.IsEmpty) {
                throw EmptyError("string");
            }

            return str.GetChar(0);
        }
开发者ID:ExpertsInside,项目名称:IronSP,代码行数:7,代码来源:CharOps.cs

示例7: Subclass

 // called by Class#new rule when creating a Ruby subclass of IO:
 public Subclass(RubyClass/*!*/ rubyClass)
     : base(rubyClass.Context)
 {
     Assert.NotNull(rubyClass);
     Debug.Assert(!rubyClass.IsSingletonClass);
     ImmediateClass = rubyClass;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:RubyIO.Subclass.cs

示例8: InducedFrom

 public static int InducedFrom(RubyClass/*!*/ self, double value)
 {
     if (value >= Int32.MinValue && value <= Int32.MaxValue) {
         return (Int32)value;
     }
     throw RubyExceptions.CreateRangeError("Float {0} out of range of {1}", value, self.Name);
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:FixnumOps.cs

示例9: RubyStruct

 // copy ctor:
 private RubyStruct(RubyClass/*!*/ rubyClass, object[]/*!*/ data)
     : base(rubyClass)
 {
     Debug.Assert(rubyClass.StructInfo != null);
     Debug.Assert(!rubyClass.IsSingletonClass);
     _data = ArrayUtils.Copy(data);
 }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:RubyStruct.cs

示例10: CreateFile

        public static RubyFile/*!*/ CreateFile(RubyClass/*!*/ self, MutableString/*!*/ path, int mode) {
            if (path.IsEmpty) {
                throw new Errno.InvalidError();
            }

            return new RubyFile(self.Context, path.ConvertToString(), (RubyFileMode)mode);
        }
开发者ID:jcteague,项目名称:ironruby,代码行数:7,代码来源:FileOps.cs

示例11: DefineGlobalClass

        protected RubyClass/*!*/ DefineGlobalClass(string/*!*/ name, Type/*!*/ type, bool isSelfContained, RubyClass/*!*/ super,
            Action<RubyModule> instanceTrait, Action<RubyModule> classTrait, Action<RubyModule> constantsInitializer,
            RubyModule/*!*/[]/*!*/ mixins, params Delegate[] factories) {

            RubyClass result = _context.DefineLibraryClass(name, type, instanceTrait, classTrait, constantsInitializer, super, mixins, factories, isSelfContained, _builtin);
            _context.ObjectClass.SetConstant(result.Name, result);
            return result;
        }
开发者ID:jcteague,项目名称:ironruby,代码行数:8,代码来源:Initializer.cs

示例12: CreateTCPSocket

        public static TCPSocket/*!*/ CreateTCPSocket(RubyClass/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ remoteHost, object remotePort) {
            int port = ConvertToPortNum(self.Context, remotePort);

            Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            socket.Connect(remoteHost.ConvertToString(), port);

            return new TCPSocket(self.Context, socket);
        }
开发者ID:mscottford,项目名称:ironruby,代码行数:8,代码来源:TCPSocket.cs

示例13: CreateSubclass

        public static Hash/*!*/ CreateSubclass(RubyClass/*!*/ self, params object[]/*!*/ items) {
            Debug.Assert(items.Length > 0);
            if (items.Length % 2 != 0) {
                throw RubyExceptions.CreateArgumentError("odd number of arguments for Hash");
            }

            return RubyUtils.SetHashElements(self.Context, Hash.CreateInstance(self), items);
        }
开发者ID:madpilot,项目名称:ironruby,代码行数:8,代码来源:HashOps.cs

示例14: Create

            public static RhoDatabase/*!*/ Create(RubyClass/*!*/ self, [NotNull]MutableString/*!*/ dbName, [NotNull]MutableString/*!*/ dbPartition)
            {
                RhoDatabase rbDB = new RhoDatabase();
                rbDB.m_db = new DBAdapter();
                rbDB.m_db.rb_open(dbName.ToString(), dbPartition.ToString());

                return rbDB;
            }
开发者ID:Chanic,项目名称:rhodes,代码行数:8,代码来源:RhoDatabase.cs

示例15: DefineGlobalClass

        protected RubyClass/*!*/ DefineGlobalClass(string/*!*/ name, Type/*!*/ type, int restrictions, RubyClass/*!*/ super,
            Action<RubyModule> instanceTrait, Action<RubyModule> classTrait, Action<RubyModule> constantsInitializer,
            RubyModule/*!*/[]/*!*/ mixins, params Delegate[] factories) {

            RubyClass result = _context.DefineLibraryClass(name, type, instanceTrait, classTrait, constantsInitializer, super, mixins, factories, (ModuleRestrictions)restrictions, _builtin);
            PublishModule(name, result);
            return result;
        }
开发者ID:ExpertsInside,项目名称:IronSP,代码行数:8,代码来源:LibraryInitializer.cs


注:本文中的IronRuby.Builtins.RubyClass类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。