sorbet-result 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.standard.yml +6 -0
  4. data/.tool-versions +1 -1
  5. data/CHANGELOG.md +21 -0
  6. data/Gemfile +3 -5
  7. data/Gemfile.lock +79 -64
  8. data/README.md +25 -2
  9. data/Rakefile +3 -5
  10. data/lib/minitest/result_assertions.rb +48 -0
  11. data/lib/sorbet-result.rb +1 -5
  12. data/lib/typed/result.rb +199 -7
  13. data/sorbet/rbi/gems/.gitattributes +1 -0
  14. data/sorbet/rbi/gems/ast@2.4.2.rbi +1 -0
  15. data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
  16. data/sorbet/rbi/gems/{io-console@0.6.0.rbi → io-console@0.7.2.rbi} +1 -0
  17. data/sorbet/rbi/gems/{json@2.6.3.rbi → json@2.7.5.rbi} +168 -72
  18. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
  19. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +240 -0
  20. data/sorbet/rbi/gems/{minitest@5.18.1.rbi → minitest@5.25.1.rbi} +337 -282
  21. data/sorbet/rbi/gems/netrc@0.11.0.rbi +1 -0
  22. data/sorbet/rbi/gems/{parallel@1.23.0.rbi → parallel@1.26.3.rbi} +38 -20
  23. data/sorbet/rbi/gems/{parser@3.2.2.3.rbi → parser@3.3.5.1.rbi} +663 -2397
  24. data/sorbet/rbi/gems/prism@1.2.0.rbi +39085 -0
  25. data/sorbet/rbi/gems/psych@5.1.2.rbi +1732 -0
  26. data/sorbet/rbi/gems/{racc@1.7.1.rbi → racc@1.8.1.rbi} +37 -36
  27. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +1 -0
  28. data/sorbet/rbi/gems/{rake@13.0.6.rbi → rake@13.2.1.rbi} +79 -75
  29. data/sorbet/rbi/gems/rbi@0.2.1.rbi +4535 -0
  30. data/sorbet/rbi/gems/{regexp_parser@2.8.1.rbi → regexp_parser@2.9.2.rbi} +190 -167
  31. data/sorbet/rbi/gems/{reline@0.3.5.rbi → reline@0.5.10.rbi} +1 -0
  32. data/sorbet/rbi/gems/{rubocop-ast@1.29.0.rbi → rubocop-ast@1.33.1.rbi} +1220 -748
  33. data/sorbet/rbi/gems/rubocop-performance@1.22.1.rbi +9 -0
  34. data/sorbet/rbi/gems/rubocop-sorbet@0.7.8.rbi +9 -0
  35. data/sorbet/rbi/gems/{rubocop@1.52.1.rbi → rubocop@1.66.1.rbi} +6236 -3446
  36. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1 -0
  37. data/sorbet/rbi/gems/spoom@1.5.0.rbi +4932 -0
  38. data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +9 -0
  39. data/sorbet/rbi/gems/standard-performance@1.5.0.rbi +9 -0
  40. data/sorbet/rbi/gems/standard-sorbet@0.0.2.rbi +53 -0
  41. data/sorbet/rbi/gems/standard@1.41.1.rbi +926 -0
  42. data/sorbet/rbi/gems/stringio@3.1.1.rbi +9 -0
  43. data/sorbet/rbi/gems/{tapioca@0.11.6.rbi → tapioca@0.16.3.rbi} +937 -635
  44. data/sorbet/rbi/gems/{thor@1.2.2.rbi → thor@1.3.2.rbi} +832 -419
  45. data/sorbet/rbi/gems/{unicode-display_width@2.4.2.rbi → unicode-display_width@2.6.0.rbi} +1 -0
  46. data/sorbet/rbi/gems/{yard-sorbet@0.8.1.rbi → yard-sorbet@0.9.0.rbi} +36 -29
  47. data/sorbet/rbi/gems/{yard@0.9.34.rbi → yard@0.9.37.rbi} +431 -271
  48. data/sorbet/tapioca/config.yml +3 -12
  49. data/sorbet/tapioca/require.rb +0 -1
  50. metadata +37 -47
  51. data/.rubocop.yml +0 -33
  52. data/lib/typed/failure.rb +0 -81
  53. data/lib/typed/success.rb +0 -80
  54. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -1083
  55. data/sorbet/rbi/gems/irb@1.7.0.rbi +0 -342
  56. data/sorbet/rbi/gems/rbi@0.0.16.rbi +0 -3008
  57. data/sorbet/rbi/gems/rexml@3.2.5.rbi +0 -4717
  58. data/sorbet/rbi/gems/rubocop-minitest@0.31.0.rbi +0 -2528
  59. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +0 -328
  60. data/sorbet/rbi/gems/rubocop-sorbet@0.7.0.rbi +0 -1043
  61. data/sorbet/rbi/gems/spoom@1.2.1.rbi +0 -2503
  62. data/sorbet/rbi/gems/unparser@0.6.8.rbi +0 -4525
  63. data/sorbet/rbi/gems/zeitwerk@2.6.8.rbi +0 -986
@@ -1,10 +1,13 @@
1
- # typed: true
1
+ # typed: false
2
2
 
3
3
  # DO NOT EDIT MANUALLY
4
4
  # This is an autogenerated file for types exported from the `json` gem.
5
5
  # Please instead update this file by running `bin/tapioca gem json`.
6
6
 
7
+
7
8
  # Extends any Class to include _json_creatable?_ method.
9
+ #
10
+ # source://json//lib/json/common.rb#726
8
11
  class Class < ::Module
9
12
  # Returns true if this class can be used to create an instance
10
13
  # from a serialised JSON string. The class has to implement a class
@@ -13,7 +16,7 @@ class Class < ::Module
13
16
  #
14
17
  # @return [Boolean]
15
18
  #
16
- # source://json//json/common.rb#700
19
+ # source://json//lib/json/common.rb#731
17
20
  def json_creatable?; end
18
21
  end
19
22
 
@@ -300,6 +303,15 @@ end
300
303
  # # Raises JSON::NestingError (nesting of 2 is too deep):
301
304
  # JSON.generate(obj, max_nesting: 2)
302
305
  #
306
+ # ====== Escaping Options
307
+ #
308
+ # Options +script_safe+ (boolean) specifies wether <tt>'\u2028'</tt>, <tt>'\u2029'</tt>
309
+ # and <tt>'/'</tt> should be escaped as to make the JSON object safe to interpolate in script
310
+ # tags.
311
+ #
312
+ # Options +ascii_only+ (boolean) specifies wether all characters outside the ASCII range
313
+ # should be escaped.
314
+ #
303
315
  # ====== Output Options
304
316
  #
305
317
  # The default formatting options generate the most compact
@@ -586,6 +598,8 @@ end
586
598
  # Parsed JSON:
587
599
  # Without custom addition: "#<Foo:0x0000000006534e80>" (String)
588
600
  # With custom addition: #<Foo:0x0000000006473bb8 @bar=0, @baz=1> (Foo)
601
+ #
602
+ # source://json//lib/json/version.rb#3
589
603
  module JSON
590
604
  private
591
605
 
@@ -617,8 +631,8 @@ module JSON
617
631
  # Output:
618
632
  # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"}
619
633
  #
620
- # source://json//json/common.rb#631
621
- def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil)); end
634
+ # source://json//lib/json/common.rb#630
635
+ def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end
622
636
 
623
637
  # :call-seq:
624
638
  # JSON.fast_generate(obj, opts) -> new_string
@@ -634,13 +648,13 @@ module JSON
634
648
  # # Raises SystemStackError (stack level too deep):
635
649
  # JSON.fast_generate(a)
636
650
  #
637
- # source://json//json/common.rb#335
651
+ # source://json//lib/json/common.rb#337
638
652
  def fast_generate(obj, opts = T.unsafe(nil)); end
639
653
 
640
654
  # :stopdoc:
641
655
  # I want to deprecate these later, so I'll first be silent about them, and later delete them.
642
656
  #
643
- # source://json//json/common.rb#335
657
+ # source://json//lib/json/common.rb#337
644
658
  def fast_unparse(obj, opts = T.unsafe(nil)); end
645
659
 
646
660
  # :call-seq:
@@ -679,7 +693,7 @@ module JSON
679
693
  # # Raises JSON::NestingError (nesting of 100 is too deep):
680
694
  # JSON.generate(a)
681
695
  #
682
- # source://json//json/common.rb#296
696
+ # source://json//lib/json/common.rb#308
683
697
  def generate(obj, opts = T.unsafe(nil)); end
684
698
 
685
699
  # :call-seq:
@@ -810,7 +824,7 @@ module JSON
810
824
  # #<Admin:0x00000000064c41f8
811
825
  # @attributes={"type"=>"Admin", "password"=>"0wn3d"}>}
812
826
  #
813
- # source://json//json/common.rb#557
827
+ # source://json//lib/json/common.rb#549
814
828
  def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
815
829
 
816
830
  # :call-seq:
@@ -821,7 +835,7 @@ module JSON
821
835
  #
822
836
  # See method #parse.
823
837
  #
824
- # source://json//json/common.rb#245
838
+ # source://json//lib/json/common.rb#257
825
839
  def load_file(filespec, opts = T.unsafe(nil)); end
826
840
 
827
841
  # :call-seq:
@@ -832,9 +846,12 @@ module JSON
832
846
  #
833
847
  # See method #parse!
834
848
  #
835
- # source://json//json/common.rb#256
849
+ # source://json//lib/json/common.rb#268
836
850
  def load_file!(filespec, opts = T.unsafe(nil)); end
837
851
 
852
+ # source://json//lib/json/common.rb#674
853
+ def merge_dump_options(opts, strict: T.unsafe(nil)); end
854
+
838
855
  # :call-seq:
839
856
  # JSON.parse(source, opts) -> object
840
857
  #
@@ -883,7 +900,7 @@ module JSON
883
900
  # # Raises JSON::ParserError (783: unexpected token at ''):
884
901
  # JSON.parse('')
885
902
  #
886
- # source://json//json/common.rb#215
903
+ # source://json//lib/json/common.rb#218
887
904
  def parse(source, opts = T.unsafe(nil)); end
888
905
 
889
906
  # :call-seq:
@@ -898,7 +915,7 @@ module JSON
898
915
  # which disables checking for nesting depth.
899
916
  # - Option +allow_nan+, if not provided, defaults to +true+.
900
917
  #
901
- # source://json//json/common.rb#230
918
+ # source://json//lib/json/common.rb#242
902
919
  def parse!(source, opts = T.unsafe(nil)); end
903
920
 
904
921
  # :call-seq:
@@ -931,28 +948,28 @@ module JSON
931
948
  # }
932
949
  # }
933
950
  #
934
- # source://json//json/common.rb#390
951
+ # source://json//lib/json/common.rb#382
935
952
  def pretty_generate(obj, opts = T.unsafe(nil)); end
936
953
 
937
954
  # :stopdoc:
938
955
  # I want to deprecate these later, so I'll first be silent about them, and later delete them.
939
956
  #
940
- # source://json//json/common.rb#390
957
+ # source://json//lib/json/common.rb#382
941
958
  def pretty_unparse(obj, opts = T.unsafe(nil)); end
942
959
 
943
960
  # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_
944
961
  #
945
- # source://json//json/common.rb#575
962
+ # source://json//lib/json/common.rb#575
946
963
  def recurse_proc(result, &proc); end
947
964
 
948
- # source://json//json/common.rb#557
965
+ # source://json//lib/json/common.rb#549
949
966
  def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
950
967
 
951
968
  # :stopdoc:
952
969
  # I want to deprecate these later, so I'll first be silent about them, and
953
970
  # later delete them.
954
971
  #
955
- # source://json//json/common.rb#296
972
+ # source://json//lib/json/common.rb#308
956
973
  def unparse(obj, opts = T.unsafe(nil)); end
957
974
 
958
975
  class << self
@@ -968,26 +985,26 @@ module JSON
968
985
  # ruby = [0, 1, nil]
969
986
  # JSON[ruby] # => '[0,1,null]'
970
987
  #
971
- # source://json//json/common.rb#18
988
+ # source://json//lib/json/common.rb#22
972
989
  def [](object, opts = T.unsafe(nil)); end
973
990
 
974
- # source://json//json/common.rb#81
991
+ # source://json//lib/json/common.rb#90
975
992
  def create_fast_state; end
976
993
 
977
994
  # Returns the current create identifier.
978
995
  # See also JSON.create_id=.
979
996
  #
980
- # source://json//json/common.rb#126
997
+ # source://json//lib/json/common.rb#129
981
998
  def create_id; end
982
999
 
983
1000
  # Sets create identifier, which is used to decide if the _json_create_
984
1001
  # hook of a class should be called; initial value is +json_class+:
985
1002
  # JSON.create_id # => 'json_class'
986
1003
  #
987
- # source://json//json/common.rb#120
1004
+ # source://json//lib/json/common.rb#123
988
1005
  def create_id=(new_value); end
989
1006
 
990
- # source://json//json/common.rb#91
1007
+ # source://json//lib/json/common.rb#100
991
1008
  def create_pretty_state; end
992
1009
 
993
1010
  # Return the constant located at _path_. The format of _path_ has to be
@@ -995,7 +1012,7 @@ module JSON
995
1012
  # level (absolute namespace path?). If there doesn't exist a constant at
996
1013
  # the given path, an ArgumentError is raised.
997
1014
  #
998
- # source://json//json/common.rb#42
1015
+ # source://json//lib/json/common.rb#51
999
1016
  def deep_const_get(path); end
1000
1017
 
1001
1018
  # :call-seq:
@@ -1026,23 +1043,23 @@ module JSON
1026
1043
  # Output:
1027
1044
  # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"}
1028
1045
  #
1029
- # source://json//json/common.rb#631
1030
- def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil)); end
1046
+ # source://json//lib/json/common.rb#630
1047
+ def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end
1031
1048
 
1032
1049
  # Sets or returns the default options for the JSON.dump method.
1033
1050
  # Initially:
1034
1051
  # opts = JSON.dump_default_options
1035
- # opts # => {:max_nesting=>false, :allow_nan=>true, :escape_slash=>false}
1052
+ # opts # => {:max_nesting=>false, :allow_nan=>true}
1036
1053
  #
1037
- # source://json//json/common.rb#596
1054
+ # source://json//lib/json/common.rb#596
1038
1055
  def dump_default_options; end
1039
1056
 
1040
1057
  # Sets or returns the default options for the JSON.dump method.
1041
1058
  # Initially:
1042
1059
  # opts = JSON.dump_default_options
1043
- # opts # => {:max_nesting=>false, :allow_nan=>true, :escape_slash=>false}
1060
+ # opts # => {:max_nesting=>false, :allow_nan=>true}
1044
1061
  #
1045
- # source://json//json/common.rb#596
1062
+ # source://json//lib/json/common.rb#596
1046
1063
  def dump_default_options=(_arg0); end
1047
1064
 
1048
1065
  # :call-seq:
@@ -1059,13 +1076,13 @@ module JSON
1059
1076
  # # Raises SystemStackError (stack level too deep):
1060
1077
  # JSON.fast_generate(a)
1061
1078
  #
1062
- # source://json//json/common.rb#335
1079
+ # source://json//lib/json/common.rb#337
1063
1080
  def fast_generate(obj, opts = T.unsafe(nil)); end
1064
1081
 
1065
1082
  # :stopdoc:
1066
1083
  # I want to deprecate these later, so I'll first be silent about them, and later delete them.
1067
1084
  #
1068
- # source://json//json/common.rb#335
1085
+ # source://json//lib/json/common.rb#337
1069
1086
  def fast_unparse(obj, opts = T.unsafe(nil)); end
1070
1087
 
1071
1088
  # :call-seq:
@@ -1104,24 +1121,24 @@ module JSON
1104
1121
  # # Raises JSON::NestingError (nesting of 100 is too deep):
1105
1122
  # JSON.generate(a)
1106
1123
  #
1107
- # source://json//json/common.rb#296
1124
+ # source://json//lib/json/common.rb#308
1108
1125
  def generate(obj, opts = T.unsafe(nil)); end
1109
1126
 
1110
1127
  # Returns the JSON generator module that is used by JSON. This is
1111
1128
  # either JSON::Ext::Generator or JSON::Pure::Generator:
1112
1129
  # JSON.generator # => JSON::Ext::Generator
1113
1130
  #
1114
- # source://json//json/common.rb#103
1131
+ # source://json//lib/json/common.rb#112
1115
1132
  def generator; end
1116
1133
 
1117
1134
  # Set the module _generator_ to be used by JSON.
1118
1135
  #
1119
- # source://json//json/common.rb#58
1136
+ # source://json//lib/json/common.rb#67
1120
1137
  def generator=(generator); end
1121
1138
 
1122
1139
  # Encodes string using String.encode.
1123
1140
  #
1124
- # source://json//json/common.rb#653
1141
+ # source://json//lib/json/common.rb#670
1125
1142
  def iconv(to, from, string); end
1126
1143
 
1127
1144
  # :call-seq:
@@ -1252,7 +1269,7 @@ module JSON
1252
1269
  # #<Admin:0x00000000064c41f8
1253
1270
  # @attributes={"type"=>"Admin", "password"=>"0wn3d"}>}
1254
1271
  #
1255
- # source://json//json/common.rb#557
1272
+ # source://json//lib/json/common.rb#549
1256
1273
  def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
1257
1274
 
1258
1275
  # Sets or returns default options for the JSON.load method.
@@ -1260,7 +1277,7 @@ module JSON
1260
1277
  # opts = JSON.load_default_options
1261
1278
  # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
1262
1279
  #
1263
- # source://json//json/common.rb#420
1280
+ # source://json//lib/json/common.rb#412
1264
1281
  def load_default_options; end
1265
1282
 
1266
1283
  # Sets or returns default options for the JSON.load method.
@@ -1268,7 +1285,7 @@ module JSON
1268
1285
  # opts = JSON.load_default_options
1269
1286
  # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
1270
1287
  #
1271
- # source://json//json/common.rb#420
1288
+ # source://json//lib/json/common.rb#412
1272
1289
  def load_default_options=(_arg0); end
1273
1290
 
1274
1291
  # :call-seq:
@@ -1279,7 +1296,7 @@ module JSON
1279
1296
  #
1280
1297
  # See method #parse.
1281
1298
  #
1282
- # source://json//json/common.rb#245
1299
+ # source://json//lib/json/common.rb#257
1283
1300
  def load_file(filespec, opts = T.unsafe(nil)); end
1284
1301
 
1285
1302
  # :call-seq:
@@ -1290,7 +1307,7 @@ module JSON
1290
1307
  #
1291
1308
  # See method #parse!
1292
1309
  #
1293
- # source://json//json/common.rb#256
1310
+ # source://json//lib/json/common.rb#268
1294
1311
  def load_file!(filespec, opts = T.unsafe(nil)); end
1295
1312
 
1296
1313
  # :call-seq:
@@ -1341,7 +1358,7 @@ module JSON
1341
1358
  # # Raises JSON::ParserError (783: unexpected token at ''):
1342
1359
  # JSON.parse('')
1343
1360
  #
1344
- # source://json//json/common.rb#215
1361
+ # source://json//lib/json/common.rb#218
1345
1362
  def parse(source, opts = T.unsafe(nil)); end
1346
1363
 
1347
1364
  # :call-seq:
@@ -1356,19 +1373,19 @@ module JSON
1356
1373
  # which disables checking for nesting depth.
1357
1374
  # - Option +allow_nan+, if not provided, defaults to +true+.
1358
1375
  #
1359
- # source://json//json/common.rb#230
1376
+ # source://json//lib/json/common.rb#242
1360
1377
  def parse!(source, opts = T.unsafe(nil)); end
1361
1378
 
1362
1379
  # Returns the JSON parser class that is used by JSON. This is either
1363
1380
  # JSON::Ext::Parser or JSON::Pure::Parser:
1364
1381
  # JSON.parser # => JSON::Ext::Parser
1365
1382
  #
1366
- # source://json//json/common.rb#29
1383
+ # source://json//lib/json/common.rb#38
1367
1384
  def parser; end
1368
1385
 
1369
1386
  # Set the JSON parser class _parser_ to be used by JSON.
1370
1387
  #
1371
- # source://json//json/common.rb#32
1388
+ # source://json//lib/json/common.rb#41
1372
1389
  def parser=(parser); end
1373
1390
 
1374
1391
  # :call-seq:
@@ -1401,111 +1418,190 @@ module JSON
1401
1418
  # }
1402
1419
  # }
1403
1420
  #
1404
- # source://json//json/common.rb#390
1421
+ # source://json//lib/json/common.rb#382
1405
1422
  def pretty_generate(obj, opts = T.unsafe(nil)); end
1406
1423
 
1407
1424
  # :stopdoc:
1408
1425
  # I want to deprecate these later, so I'll first be silent about them, and later delete them.
1409
1426
  #
1410
- # source://json//json/common.rb#390
1427
+ # source://json//lib/json/common.rb#382
1411
1428
  def pretty_unparse(obj, opts = T.unsafe(nil)); end
1412
1429
 
1413
1430
  # Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_
1414
1431
  #
1415
- # source://json//json/common.rb#575
1432
+ # source://json//lib/json/common.rb#575
1416
1433
  def recurse_proc(result, &proc); end
1417
1434
 
1418
- # source://json//json/common.rb#557
1435
+ # source://json//lib/json/common.rb#549
1419
1436
  def restore(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end
1420
1437
 
1421
1438
  # Sets or Returns the JSON generator state class that is used by JSON. This is
1422
1439
  # either JSON::Ext::Generator::State or JSON::Pure::Generator::State:
1423
1440
  # JSON.state # => JSON::Ext::Generator::State
1424
1441
  #
1425
- # source://json//json/common.rb#108
1442
+ # source://json//lib/json/common.rb#117
1426
1443
  def state; end
1427
1444
 
1428
1445
  # Sets or Returns the JSON generator state class that is used by JSON. This is
1429
1446
  # either JSON::Ext::Generator::State or JSON::Pure::Generator::State:
1430
1447
  # JSON.state # => JSON::Ext::Generator::State
1431
1448
  #
1432
- # source://json//json/common.rb#108
1449
+ # source://json//lib/json/common.rb#117
1433
1450
  def state=(_arg0); end
1434
1451
 
1435
1452
  # :stopdoc:
1436
1453
  # I want to deprecate these later, so I'll first be silent about them, and
1437
1454
  # later delete them.
1438
1455
  #
1439
- # source://json//json/common.rb#296
1456
+ # source://json//lib/json/common.rb#308
1440
1457
  def unparse(obj, opts = T.unsafe(nil)); end
1458
+
1459
+ private
1460
+
1461
+ # source://json//lib/json/common.rb#674
1462
+ def merge_dump_options(opts, strict: T.unsafe(nil)); end
1441
1463
  end
1442
1464
  end
1443
1465
 
1444
- # source://json//json/common.rb#114
1445
- JSON::CREATE_ID_TLS_KEY = T.let(T.unsafe(nil), String)
1466
+ # source://json//lib/json/ext/generator/state.rb#6
1467
+ class JSON::Ext::Generator::State
1468
+ # call-seq: new(opts = {})
1469
+ #
1470
+ # Instantiates a new State object, configured by _opts_.
1471
+ #
1472
+ # _opts_ can have the following keys:
1473
+ #
1474
+ # * *indent*: a string used to indent levels (default: ''),
1475
+ # * *space*: a string that is put after, a : or , delimiter (default: ''),
1476
+ # * *space_before*: a string that is put before a : pair delimiter (default: ''),
1477
+ # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
1478
+ # * *array_nl*: a string that is put at the end of a JSON array (default: ''),
1479
+ # * *allow_nan*: true if NaN, Infinity, and -Infinity should be
1480
+ # generated, otherwise an exception is thrown, if these values are
1481
+ # encountered. This options defaults to false.
1482
+ # * *ascii_only*: true if only ASCII characters should be generated. This
1483
+ # option defaults to false.
1484
+ # * *buffer_initial_length*: sets the initial length of the generator's
1485
+ # internal buffer.
1486
+ #
1487
+ # @return [State] a new instance of State
1488
+ #
1489
+ # source://json//lib/json/ext/generator/state.rb#25
1490
+ def initialize(opts = T.unsafe(nil)); end
1446
1491
 
1447
- # source://json//json/common.rb#111
1448
- JSON::DEFAULT_CREATE_ID = T.let(T.unsafe(nil), String)
1492
+ # call-seq: [](name)
1493
+ #
1494
+ # Returns the value returned by method +name+.
1495
+ #
1496
+ # source://json//lib/json/ext/generator/state.rb#113
1497
+ def [](name); end
1449
1498
 
1499
+ # call-seq: []=(name, value)
1500
+ #
1501
+ # Sets the attribute name to value.
1502
+ #
1503
+ # source://json//lib/json/ext/generator/state.rb#125
1504
+ def []=(name, value); end
1505
+
1506
+ # call-seq: configure(opts)
1507
+ #
1508
+ # Configure this State instance with the Hash _opts_, and return
1509
+ # itself.
1510
+ #
1511
+ # source://json//lib/json/ext/generator/state.rb#35
1512
+ def configure(opts); end
1513
+
1514
+ # call-seq: configure(opts)
1515
+ #
1516
+ # Configure this State instance with the Hash _opts_, and return
1517
+ # itself.
1518
+ #
1519
+ # source://json//lib/json/ext/generator/state.rb#35
1520
+ def merge(opts); end
1521
+
1522
+ # call-seq: to_h
1523
+ #
1524
+ # Returns the configuration instance variables as a hash, that can be
1525
+ # passed to the configure method.
1526
+ #
1527
+ # source://json//lib/json/ext/generator/state.rb#84
1528
+ def to_h; end
1529
+
1530
+ # call-seq: to_h
1531
+ #
1532
+ # Returns the configuration instance variables as a hash, that can be
1533
+ # passed to the configure method.
1534
+ #
1535
+ # source://json//lib/json/ext/generator/state.rb#84
1536
+ def to_hash; end
1537
+ end
1538
+
1539
+ # source://json//lib/json/generic_object.rb#9
1450
1540
  class JSON::GenericObject < ::OpenStruct
1451
- # source://json//json/generic_object.rb#63
1541
+ # source://json//lib/json/generic_object.rb#67
1452
1542
  def as_json(*_arg0); end
1453
1543
 
1454
- # source://json//json/generic_object.rb#47
1544
+ # source://json//lib/json/generic_object.rb#51
1455
1545
  def to_hash; end
1456
1546
 
1457
- # source://json//json/generic_object.rb#67
1547
+ # source://json//lib/json/generic_object.rb#71
1458
1548
  def to_json(*a); end
1459
1549
 
1460
- # source://json//json/generic_object.rb#59
1550
+ # source://json//lib/json/generic_object.rb#63
1461
1551
  def |(other); end
1462
1552
 
1463
1553
  class << self
1464
- # source://json//json/generic_object.rb#41
1554
+ # source://json//lib/json/generic_object.rb#45
1465
1555
  def dump(obj, *args); end
1466
1556
 
1467
- # source://json//json/generic_object.rb#21
1557
+ # source://json//lib/json/generic_object.rb#25
1468
1558
  def from_hash(object); end
1469
1559
 
1470
1560
  # Sets the attribute json_creatable
1471
1561
  #
1472
1562
  # @param value the value to set the attribute json_creatable to.
1473
1563
  #
1474
- # source://json//json/generic_object.rb#13
1564
+ # source://json//lib/json/generic_object.rb#17
1475
1565
  def json_creatable=(_arg0); end
1476
1566
 
1477
1567
  # @return [Boolean]
1478
1568
  #
1479
- # source://json//json/generic_object.rb#9
1569
+ # source://json//lib/json/generic_object.rb#13
1480
1570
  def json_creatable?; end
1481
1571
 
1482
- # source://json//json/generic_object.rb#15
1572
+ # source://json//lib/json/generic_object.rb#19
1483
1573
  def json_create(data); end
1484
1574
 
1485
- # source://json//json/generic_object.rb#36
1575
+ # source://json//lib/json/generic_object.rb#40
1486
1576
  def load(source, proc = T.unsafe(nil), opts = T.unsafe(nil)); end
1487
1577
  end
1488
1578
  end
1489
1579
 
1490
1580
  # The base exception for JSON errors.
1581
+ #
1582
+ # source://json//lib/json/common.rb#140
1491
1583
  class JSON::JSONError < ::StandardError
1492
1584
  class << self
1493
- # source://json//json/common.rb#138
1585
+ # source://json//lib/json/common.rb#141
1494
1586
  def wrap(exception); end
1495
1587
  end
1496
1588
  end
1497
1589
 
1498
- # source://json//json/common.rb#35
1590
+ # source://json//lib/json/common.rb#7
1591
+ JSON::NOT_SET = T.let(T.unsafe(nil), Object)
1592
+
1593
+ # source://json//lib/json/common.rb#44
1499
1594
  JSON::Parser = JSON::Ext::Parser
1500
1595
 
1501
- # source://json//json/common.rb#73
1596
+ # source://json//lib/json/common.rb#82
1502
1597
  JSON::State = JSON::Ext::Generator::State
1503
1598
 
1504
1599
  # For backwards compatibility
1505
1600
  #
1506
- # source://json//json/common.rb#159
1601
+ # source://json//lib/json/common.rb#162
1507
1602
  JSON::UnparserError = JSON::GeneratorError
1508
1603
 
1604
+ # source://json//lib/json/common.rb#684
1509
1605
  module Kernel
1510
1606
  private
1511
1607
 
@@ -1516,18 +1612,18 @@ module Kernel
1516
1612
  # The _opts_ argument is passed through to generate/parse respectively. See
1517
1613
  # generate and parse for their documentation.
1518
1614
  #
1519
- # source://json//json/common.rb#685
1615
+ # source://json//lib/json/common.rb#711
1520
1616
  def JSON(object, *args); end
1521
1617
 
1522
1618
  # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in
1523
1619
  # one line.
1524
1620
  #
1525
- # source://json//json/common.rb#663
1621
+ # source://json//lib/json/common.rb#689
1526
1622
  def j(*objs); end
1527
1623
 
1528
1624
  # Outputs _objs_ to STDOUT as JSON strings in a pretty format, with
1529
1625
  # indentation and over many lines.
1530
1626
  #
1531
- # source://json//json/common.rb#672
1627
+ # source://json//lib/json/common.rb#698
1532
1628
  def jj(*objs); end
1533
1629
  end