Skip to content

Commit 56d9e80

Browse files
committed
Rename to reduce top-level interface
from _JsonToWritableIO to JSON::_WritableIO from _JsonWrite to JSON::_Write
1 parent fbe0790 commit 56d9e80

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

stdlib/json/0/json.rbs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@ interface _ToJson
22
def to_json: (?JSON::State state) -> String
33
end
44

5-
interface _JsonToWritableIO
6-
def to_io: () -> _JsonWrite
7-
end
8-
9-
interface _JsonWrite
10-
def write: (String json) -> void
11-
12-
def flush: () -> void
13-
end
14-
155
# <!-- rdoc-file=ext/json/lib/json/common.rb -->
166
# The base exception for JSON errors.
177
#
@@ -666,6 +656,16 @@ module JSON
666656
type parser = singleton(::JSON::Ext::Parser) | singleton(::JSON::Pure::Parser)
667657
type state = singleton(JSON::Ext::Generator::State) | singleton(JSON::Pure::Generator::State)
668658

659+
interface _WritableIO
660+
def to_io: () -> _Write
661+
end
662+
663+
interface _Write
664+
def write: (String json) -> void
665+
666+
def flush: () -> void
667+
end
668+
669669
interface _ReadableIO
670670
def to_io: () -> _Read
671671
end
@@ -743,8 +743,8 @@ module JSON
743743
# {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"}
744744
#
745745
def self?.dump: (_ToJson obj, ?Integer limit) -> String
746-
| (_ToJson obj, _JsonToWritableIO anIO) -> _JsonWrite
747-
| (_ToJson obj, _JsonWrite anIO, ?Integer limit) -> _JsonWrite
746+
| (_ToJson obj, _WritableIO anIO) -> _Write
747+
| (_ToJson obj, _Write anIO, ?Integer limit) -> _Write
748748

749749
# <!-- rdoc-file=ext/json/lib/json/common.rb -->
750750
# Sets or returns the default options for the JSON.dump method. Initially:

0 commit comments

Comments
 (0)