stdlib/builtin/builtin.rbs in rbs-0.14.0 vs stdlib/builtin/builtin.rbs in rbs-0.15.0
- old
+ new
@@ -28,15 +28,43 @@
interface _Each[out A, out B]
def each: { (A) -> void } -> B
end
+interface _Reader
+ def read: (?int length, ?string outbuf) -> String?
+end
+
+interface _Writer
+ # Writes the +data+ string. Returns the number of bytes written
+ def write: (*_ToS data) -> Integer
+end
+
+interface _Rewindable
+ # Positions the stream to the beginning of input, resetting `lineno` to zero.
+ #
+ def rewind: () -> Integer
+end
+
+interface _ToIO
+ def to_io: () -> IO
+end
+
interface _Exception
def exception: () -> Exception
| (String arg0) -> Exception
end
type int = Integer | _ToInt
type real = Integer | Float | Rational
type string = String | _ToStr
type encoding = Encoding | string
+
+type io = IO | _ToIO
+
+# `boolish` is a type for documentation.
+# It means the value of this type is only for testing a condition.
+# Unlike `bool` type, it doesn't require the value is one of `true` or `false`.
+# Any Ruby object can have `boolish` type.
+#
+type boolish = top