Exemple #1
0
        public static MutableString /*!*/ Inspect(RubyContext /*!*/ context, TypeGroup /*!*/ self)
        {
            var result = MutableString.CreateMutable(context.GetIdentifierEncoding());

            result.Append("#<TypeGroup: ");

            bool isFirst = true;

            foreach (var entry in self.TypesByArity.ToSortedList((x, y) => x.Key - y.Key))
            {
                Type type = entry.Value;

                if (!isFirst)
                {
                    result.Append(", ");
                }
                else
                {
                    isFirst = false;
                }

                result.Append(context.GetTypeName(type, true));
            }
            result.Append('>');

            return(result);
        }
Exemple #2
0
 public override string GetTypeName(Type /*!*/ t)
 {
     return(_context.GetTypeName(t, true));
 }
Exemple #3
0
        public static MutableString/*!*/ Inspect(RubyContext/*!*/ context, TypeGroup/*!*/ self) {
            var result = MutableString.CreateMutable(RubyEncoding.ClassName);
            result.Append("#<TypeGroup: ");

            bool isFirst = true;
            foreach (var entry in self.TypesByArity.ToSortedList((x, y) => x.Key - y.Key)) {
                Type type = entry.Value;

                if (!isFirst) {
                    result.Append(", ");
                } else {
                    isFirst = false;
                }

                result.Append(context.GetTypeName(type, true));
            }
            result.Append('>');

            return result;
        }
Exemple #4
0
 public static Exception/*!*/ MakeTypeConversionError(RubyContext/*!*/ context, object value, Type/*!*/ type) {
     return RubyExceptions.CreateTypeConversionError(context.GetClassDisplayName(value), context.GetTypeName(type, true));
 }