Skip to content

Commit 281ca29

Browse files
committed
Rename to reduce top-level type alias
from json_state to JSON::state
1 parent 1b5502b commit 281ca29

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

stdlib/json/0/json.rbs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ end
9494
class JSON::Pure::Parser
9595
end
9696

97-
type json_state = singleton(JSON::Ext::Generator::State) | singleton(JSON::Pure::Generator::State)
98-
9997
# <!-- rdoc-file=ext/json/lib/json.rb -->
10098
# # JavaScript Object Notation (JSON)
10199
#
@@ -674,6 +672,7 @@ module JSON
674672
type options = Hash[Symbol, untyped]
675673
type generator = singleton(::JSON::Ext::Generator) | singleton(::JSON::Pure::Generator)
676674
type parser = singleton(::JSON::Ext::Parser) | singleton(::JSON::Pure::Parser)
675+
type state = singleton(JSON::Ext::Generator::State) | singleton(JSON::Pure::Generator::State)
677676

678677
# <!--
679678
# rdoc-file=ext/json/lib/json/common.rb
@@ -1144,19 +1143,19 @@ module JSON
11441143
# <!-- rdoc-file=ext/json/lib/json/common.rb -->
11451144
# Sets or Returns the JSON generator state class that is used by JSON.
11461145
#
1147-
def self.state: () -> json_state
1146+
def self.state: () -> state
11481147

11491148
# <!-- rdoc-file=ext/json/lib/json/common.rb -->
11501149
# Sets or Returns the JSON generator state class that is used by JSON.
11511150
#
1152-
def self.state=: (json_state) -> json_state
1151+
def self.state=: (state) -> state
11531152

11541153
alias self.unparse self.generate
11551154

11561155
alias unparse generate
11571156
end
11581157

1159-
JSON::FAST_STATE_PROTOTYPE: json_state
1158+
JSON::FAST_STATE_PROTOTYPE: JSON::state
11601159

11611160
JSON::Infinity: Float
11621161

@@ -1166,9 +1165,9 @@ JSON::MinusInfinity: Float
11661165

11671166
JSON::NaN: Float
11681167

1169-
JSON::PRETTY_STATE_PROTOTYPE: json_state
1168+
JSON::PRETTY_STATE_PROTOTYPE: JSON::state
11701169

1171-
JSON::SAFE_STATE_PROTOTYPE: json_state
1170+
JSON::SAFE_STATE_PROTOTYPE: JSON::state
11721171

11731172
JSON::VERSION: String
11741173

0 commit comments

Comments
 (0)