Ejemplo n.º 1
0
        public static RubyMethod /*!*/ Bind(UnboundMethod /*!*/ self, object target)
        {
            RubyContext context = self._targetConstraint.Context;

            if (!context.IsKindOf(target, self._targetConstraint))
            {
                throw RubyExceptions.CreateTypeError(
                          "bind argument must be an instance of {0}", self._targetConstraint.GetName(context)
                          );
            }

            return(new RubyMethod(target, self._info, self._name));
        }