• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Builtins.RubyClass类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CreateGeneratorState

 public static GeneratorState CreateGeneratorState(RubyClass/*!*/ self, [Optional]Hash configuration)
 {
     GeneratorState state = new GeneratorState();
     if (configuration != null) {
         Reinitialize(self.Context, state, configuration);
     }
     return state;
 }
开发者ID:nrk,项目名称:ironruby-json,代码行数:8,代码来源:GeneratorStateOps.cs


示例17: Create

        /// <summary>
        /// Struct#new
        /// Creates Struct classes with the specified name and members
        /// </summary>
        private static object Create(BlockParam block, RubyClass/*!*/ self, string className, string/*!*/[]/*!*/ attributeNames) {
            var result = RubyStruct.DefineStruct(self, className, attributeNames);

            if (block != null) {
                return RubyUtils.EvaluateInModule(result, block, null, result);
            }

            return result;
        }
开发者ID:jschementi,项目名称:iron,代码行数:13,代码来源:StructOps.cs


示例18: CreateIO

        public static RubyIO/*!*/ CreateIO(RubyClass/*!*/ self, 
            [DefaultProtocol]int fileDescriptor, [DefaultProtocol, NotNull, Optional]MutableString modeString) {

            // TODO: a new RubyIO should be created here
            RubyIO result = self.Context.GetDescriptor(fileDescriptor);
            if (modeString != null) {
                result.ResetIOMode(modeString.ConvertToString());
            }
            return result;
        }
开发者ID:m4dc4p,项目名称:ironruby,代码行数:10,代码来源:IoOps.cs


示例19: CreateMissingDefaultConstructorError

        public static Exception/*!*/ CreateMissingDefaultConstructorError(RubyClass/*!*/ rubyClass, string/*!*/ initializerOwnerName) {
            Debug.Assert(rubyClass.IsRubyClass);

            Type baseType = rubyClass.GetUnderlyingSystemType().BaseType;
            Debug.Assert(baseType != null);

            return CreateTypeError("can't allocate class `{1}' that derives from type `{0}' with no default constructor;" +
                " define {1}#new singleton method instead of {2}#initialize",
                rubyClass.Context.GetTypeName(baseType, true), rubyClass.Name, initializerOwnerName
            );
        }
开发者ID:cleydson,项目名称:ironruby,代码行数:11,代码来源:RubyExceptions.cs


示例20: CreateSubclass

 public static Hash/*!*/ CreateSubclass(ConversionStorage<IList>/*!*/ toAry, RubyClass/*!*/ self, [NotNull]IList/*!*/ list) {
     Hash result = Hash.CreateInstance(self);
     var toArySite = toAry.GetSite(TryConvertToArrayAction.Make(toAry.Context));
     foreach (object item in list) {
         IList pair = toArySite.Target(toArySite, item);
         if (pair != null && pair.Count >= 1 && pair.Count <= 2) {
             RubyUtils.SetHashElement(self.Context, result, pair[0], (pair.Count == 2) ? pair[1] : null);
         }
     }
     return result;
 }
开发者ID:jschementi,项目名称:iron,代码行数:11,代码来源:HashOps.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Builtins.RubyEncoding类代码示例发布时间:2022-05-26
下一篇:
C# Builtins.Range类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap