Esempio n. 1
0
        public static MutableString /*!*/ Putc(BinaryOpStorage /*!*/ writeStorage, object self, [NotNull] MutableString /*!*/ val)
        {
            if (val.IsEmpty)
            {
                throw RubyExceptions.CreateTypeError("can't convert String into Integer");
            }

            // writes a single byte into the output stream:
            var c = MutableString.CreateBinary(val.GetBinarySlice(0, 1));

            Protocols.Write(writeStorage, self, c);
            return(val);
        }
Esempio n. 2
0
        public static MutableString /*!*/ Putc(RubyContext /*!*/ context, object self, [NotNull] MutableString /*!*/ val)
        {
            if (val.IsEmpty)
            {
                throw RubyExceptions.CreateTypeError("can't convert String into Integer");
            }

            // writes a single byte into the output stream:
            var c = MutableString.CreateBinary(val.GetBinarySlice(0, 1));

            _WriteSite.Target(_WriteSite, context, self, c);

            return(val);
        }