/IronPython_Main/Languages/Ruby/Ruby/Builtins/Hash.Subclass.cs
# · C# · 38 lines · 20 code · 3 blank · 15 comment · 0 complexity · 108f09f6bbdaeecc0d493ab841cdc5dd MD5 · raw file
- /* ****************************************************************************
- *
- * Copyright (c) Microsoft Corporation.
- *
- * This source code is subject to terms and conditions of the Apache License, Version 2.0. A
- * copy of the license can be found in the License.html file at the root of this distribution. If
- * you cannot locate the Apache License, Version 2.0, please send an email to
- * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
- * by the terms of the Apache License, Version 2.0.
- *
- * You must not remove this notice, or any other, from this software.
- *
- *
- * ***************************************************************************/
-
- using IronRuby.Runtime;
- using Microsoft.Scripting.Utils;
- using IronRuby.Compiler.Generation;
- using System.Collections.Generic;
- using System.Diagnostics;
-
- namespace IronRuby.Builtins {
- public partial class Hash {
- public sealed partial class Subclass : Hash, IRubyObject {
- // called by Class#new rule when creating a Ruby subclass of String:
- public Subclass(RubyClass/*!*/ rubyClass)
- : base(rubyClass.Context) {
- Assert.NotNull(rubyClass);
- Debug.Assert(!rubyClass.IsSingletonClass);
- ImmediateClass = rubyClass;
- }
-
- protected override Hash/*!*/ CreateInstance() {
- return new Subclass(ImmediateClass.NominalClass);
- }
- }
- }
- }