public static RubyModule/*!*/ Of(RubyContext/*!*/ context, TypeGroup/*!*/ self, int genericArity) { TypeTracker tracker = self.GetTypeForArity(genericArity); if (tracker == null) { throw RubyExceptions.CreateArgumentError(String.Format("Type group `{0}' does not contain a type of generic arity {1}", self.Name, genericArity)); } return context.GetModule(tracker.Type); }
public static RubyModule /*!*/ Of(RubyContext /*!*/ context, TypeGroup /*!*/ self, int genericArity) { TypeTracker tracker = self.GetTypeForArity(genericArity); if (tracker == null) { throw RubyExceptions.CreateArgumentError("Type group `{0}' does not contain a type of generic arity {1}", self.Name, genericArity); } return(context.GetModule(tracker.Type)); }
public static object EachType(RubyContext/*!*/ context, BlockParam/*!*/ block, TypeGroup/*!*/ self) { if (block == null) { throw RubyExceptions.NoBlockGiven(); } foreach (Type type in self.Types) { RubyModule module = context.GetModule(type); object result; if (block.Yield(module, out result)) { return result; } } return self; }
public static RubyModule/*!*/ Of(RubyContext/*!*/ context, TypeGroup/*!*/ self, [NotNull]params object[]/*!*/ typeArgs) { TypeTracker tracker = self.GetTypeForArity(typeArgs.Length); if (tracker == null) { throw RubyExceptions.CreateArgumentError(String.Format("Invalid number of type arguments for `{0}'", self.Name)); } Type concreteType; if (typeArgs.Length > 0) { concreteType = tracker.Type.MakeGenericType(Protocols.ToTypes(context, typeArgs)); } else { concreteType = tracker.Type; } return context.GetModule(concreteType); }
public static object EachType(RubyContext /*!*/ context, BlockParam /*!*/ block, TypeGroup /*!*/ self) { if (block == null) { throw RubyExceptions.NoBlockGiven(); } foreach (Type type in self.Types) { RubyModule module = context.GetModule(type); object result; if (block.Yield(module, out result)) { return(result); } } return(self); }
public static RubyModule /*!*/ Of(RubyContext /*!*/ context, TypeGroup /*!*/ self, [NotNullItems] params object /*!*/[] /*!*/ typeArgs) { TypeTracker tracker = self.GetTypeForArity(typeArgs.Length); if (tracker == null) { throw RubyExceptions.CreateArgumentError("Invalid number of type arguments for `{0}'", self.Name); } Type concreteType; if (typeArgs.Length > 0) { concreteType = tracker.Type.MakeGenericType(Protocols.ToTypes(context, typeArgs)); } else { concreteType = tracker.Type; } return(context.GetModule(concreteType)); }
public static RubyModule /*!*/ ToModule(RubyContext /*!*/ context, Type /*!*/ self) { return(context.GetModule(self)); }
public static RubyModule ToModule(RubyContext/*!*/ context, Type/*!*/ self) { return context.GetModule(self); }
public static RubyModule/*!*/ ToModule(RubyContext/*!*/ context, TypeTracker/*!*/ self) { return context.GetModule(self.Type); }