public static Proc/*!*/ ToProc(RubyContext/*!*/ context, RubyMethod/*!*/ self) { RubyMethodInfo mi = self.Info as RubyMethodInfo; if (mi != null) { return Proc.Create(context, mi.Method, self.Target, mi.Arity); } // TODO: figure out what the semantics should be for a set of CLR methods returned ... throw new NotImplementedException(); }
public static Proc /*!*/ ToProc(RubyContext /*!*/ context, RubyMethod /*!*/ self) { RubyMethodInfo mi = self.Info as RubyMethodInfo; if (mi != null) { return(Proc.Create(context, mi.Method, self.Target, mi.Arity)); } // TODO: figure out what the semantics should be for a set of CLR methods returned ... throw new NotImplementedException(); }
public static RubyMethod /*!*/ DefineMethod(RubyScope /*!*/ scope, RubyModule /*!*/ self, [NotNull] ClrName /*!*/ methodName, [NotNull] RubyMethod /*!*/ method) { var result = DefineMethod(scope, self, methodName.MangledName, method); if (methodName.HasMangledName) { self.AddMethodAlias(methodName.ActualName, methodName.MangledName); } return(result); }
public static Proc /*!*/ ToProc(RubyScope /*!*/ scope, RubyMethod /*!*/ self) { return(self.ToProc(scope)); }
public static RubyMethod /*!*/ BindGenericParameters(RubyContext /*!*/ context, RubyMethod /*!*/ self, [NotNullItems] params object /*!*/[] /*!*/ typeArgs) { return(new RubyMethod(self.Target, BindGenericParameters(context, self.Info, self.Name, typeArgs), self.Name)); }
public static bool Equal(RubyMethod /*!*/ self, object other) { return(false); }
public static RubyMethod /*!*/ Clone(RubyMethod /*!*/ self) { return(new RubyMethod(self.Target, self.Info, self.Name)); }
public static RubyArray GetParameters(RubyMethod/*!*/ self) { return self.Info.GetRubyParameterArray(); }
public static RubyArray /*!*/ GetClrMembers(RubyMethod /*!*/ self) { return(new RubyArray(self.Info.GetMembers())); }
public Meta(Expression /*!*/ expression, Restrictions /*!*/ restrictions, RubyMethod /*!*/ value) : base(expression, restrictions, value) { ContractUtils.RequiresNotNull(value, "value"); }
public static RubyMethod/*!*/ SelectOverload_old(RubyContext/*!*/ context, RubyMethod/*!*/ self, [NotNullItems]params object/*!*/[]/*!*/ parameterTypes) { throw RubyExceptions.CreateNameError("Method#overloads is an obsolete name, use Method#overload."); }
public static Delegate/*!*/ CreateDelegateFromMethod(Type/*!*/ type, RubyMethod/*!*/ method) { return method.Info.Context.GetDelegate(method, type); }
public static RubyContext/*!*/ GetContextFromMethod(RubyMethod/*!*/ method) { return method.Info.Context; }
public static RubyMethod/*!*/ GetOverloads(RubyContext/*!*/ context, RubyMethod/*!*/ self, [NotNull]params object[]/*!*/ parameterTypes) { return new RubyMethod(self.Target, GetOverloads(context, self.Info, self.Name, parameterTypes), self.Name); }
public Meta(Expression/*!*/ expression, BindingRestrictions/*!*/ restrictions, RubyMethod/*!*/ value) : base(expression, restrictions, value) { ContractUtils.RequiresNotNull(value, "value"); }
public static RubyArray GetSourceLocation(RubyMethod/*!*/ self) { return UnboundMethod.GetSourceLocation(self.Info); }
public static RubyArray GetSourceLocation(RubyMethod /*!*/ self) { return(UnboundMethod.GetSourceLocation(self.Info)); }
public static RubyMethod /*!*/ SelectOverload_old(RubyContext /*!*/ context, RubyMethod /*!*/ self, [NotNullItems] params object /*!*/[] /*!*/ parameterTypes) { throw RubyExceptions.CreateNameError("Method#overloads is an obsolete name, use Method#overload."); }
public static RubyMethod/*!*/ BindGenericParameters(RubyContext/*!*/ context, RubyMethod/*!*/ self, [NotNullItems]params object/*!*/[]/*!*/ typeArgs) { return new RubyMethod(self.Target, BindGenericParameters(context, self.Info, self.Name, typeArgs), self.Name); }
public static RubyArray /*!*/ GetParameters(RubyMethod /*!*/ self) { return(self.Info.GetRubyParameterArray()); }
public static RubyMethod/*!*/ SelectOverload(RubyContext/*!*/ context, RubyMethod/*!*/ self, [NotNullItems]params object/*!*/[]/*!*/ parameterTypes) { return new RubyMethod(self.Target, SelectOverload(context, self.Info, self.Name, parameterTypes), self.Name); }
public static RubyArray/*!*/ GetClrMembers(RubyMethod/*!*/ self) { return new RubyArray(self.Info.GetMembers()); }
public static RubyMethod /*!*/ SelectOverload(RubyContext /*!*/ context, RubyMethod /*!*/ self, [NotNullItems] params object /*!*/[] /*!*/ parameterTypes) { return(new RubyMethod(self.Target, SelectOverload(context, self.Info, self.Name, parameterTypes), self.Name)); }
public static bool Equal(RubyMethod/*!*/ self, [NotNull]RubyMethod/*!*/ other) { // TODO: method with changed visibility, define_methods, module_functions, aliases: return ReferenceEquals(self.Target, other.Target) && ReferenceEquals(self.Info, other.Info); }
public static bool Equal(RubyMethod /*!*/ self, [NotNull] RubyMethod /*!*/ other) { // TODO: method with changed visibility, define_methods, module_functions, aliases: return(ReferenceEquals(self.Target, other.Target) && ReferenceEquals(self.Info, other.Info)); }
public static bool Equal(RubyMethod/*!*/ self, object other) { return false; }
public static int GetArity(RubyMethod /*!*/ self) { return(self.Info.GetArity()); }
public static int GetArity(RubyMethod/*!*/ self) { return self.Info.GetArity(); }
public static MutableString /*!*/ ToS(RubyContext /*!*/ context, RubyMethod /*!*/ self) { return(UnboundMethod.ToS(context, self.Name, self.Info.DeclaringModule, self.GetTargetClass(), "Method")); }
public static RubyMethod/*!*/ Clone(RubyMethod/*!*/ self) { return new RubyMethod(self.Target, self.Info, self.Name); }
public static UnboundMethod /*!*/ Unbind(RubyMethod /*!*/ self) { return(new UnboundMethod(self.GetTargetClass(), self.Name, self.Info)); }
public static MutableString/*!*/ ToS(RubyContext/*!*/ context, RubyMethod/*!*/ self) { return UnboundMethod.ToS(context, self.Name, self.Info.DeclaringModule, self.GetTargetClass(), "Method"); }
public static RubyMethod /*!*/ DefineMethod(RubyScope /*!*/ scope, RubyModule /*!*/ self, [DefaultProtocol, NotNull] string /*!*/ methodName, [NotNull] RubyMethod /*!*/ method) { DefineMethod(scope, self, methodName, method.Info, method.GetTargetClass()); return(method); }
public static Proc/*!*/ ToProc(RubyScope/*!*/ scope, RubyMethod/*!*/ self) { return self.ToProc(scope); }
public static RubyMethod /*!*/ DefineMethod(RubyModule /*!*/ self, [DefaultProtocol] string /*!*/ methodName, [NotNull] RubyMethod /*!*/ method) { // MRI 1.8 does the check when the method is called, 1.9 checks it upfront as we do: var targetClass = method.GetTargetClass(); if (!self.HasAncestor(targetClass)) { throw RubyExceptions.CreateTypeError( String.Format("bind argument must be a subclass of {0}", targetClass.Name) ); } self.AddDefinedMethod(methodName, method.Info); return(method); }
public static UnboundMethod/*!*/ Unbind(RubyMethod/*!*/ self) { return new UnboundMethod(self.GetTargetClass(), self.Name, self.Info); }