lithic 0.1.0.pre.alpha.10 → 0.1.0.pre.alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +267 -0
- data/README.md +5 -12
- data/SECURITY.md +27 -0
- data/lib/lithic/client.rb +5 -11
- data/lib/lithic/internal/cursor_page.rb +25 -25
- data/lib/lithic/internal/single_page.rb +25 -25
- data/lib/lithic/internal/transport/base_client.rb +13 -3
- data/lib/lithic/internal/transport/pooled_net_requester.rb +6 -2
- data/lib/lithic/internal/type/array_of.rb +17 -2
- data/lib/lithic/internal/type/base_model.rb +33 -5
- data/lib/lithic/internal/type/base_page.rb +1 -0
- data/lib/lithic/internal/type/boolean.rb +2 -0
- data/lib/lithic/internal/type/converter.rb +24 -0
- data/lib/lithic/internal/type/enum.rb +19 -3
- data/lib/lithic/internal/type/hash_of.rb +17 -2
- data/lib/lithic/internal/type/io_like.rb +2 -0
- data/lib/lithic/internal/type/union.rb +17 -3
- data/lib/lithic/internal/type/unknown.rb +2 -0
- data/lib/lithic/internal/util.rb +36 -9
- data/lib/lithic/internal.rb +5 -1
- data/lib/lithic/version.rb +1 -1
- data/rbi/lib/lithic/client.rbi +3 -2
- data/rbi/lib/lithic/internal/cursor_page.rbi +1 -0
- data/rbi/lib/lithic/internal/single_page.rbi +1 -0
- data/rbi/lib/lithic/internal/transport/base_client.rbi +1 -0
- data/rbi/lib/lithic/internal/type/array_of.rbi +12 -9
- data/rbi/lib/lithic/internal/type/base_model.rbi +7 -0
- data/rbi/lib/lithic/internal/type/boolean.rbi +4 -5
- data/rbi/lib/lithic/internal/type/converter.rbi +8 -0
- data/rbi/lib/lithic/internal/type/enum.rbi +4 -0
- data/rbi/lib/lithic/internal/type/hash_of.rbi +12 -9
- data/rbi/lib/lithic/internal/type/io_like.rbi +4 -5
- data/rbi/lib/lithic/internal/type/union.rbi +4 -0
- data/rbi/lib/lithic/internal/type/unknown.rbi +4 -5
- data/rbi/lib/lithic/internal/util.rbi +15 -0
- data/rbi/lib/lithic/internal.rbi +1 -1
- data/sig/lithic/internal/type/array_of.rbs +2 -0
- data/sig/lithic/internal/type/base_model.rbs +2 -0
- data/sig/lithic/internal/type/converter.rbs +4 -0
- data/sig/lithic/internal/type/enum.rbs +2 -0
- data/sig/lithic/internal/type/hash_of.rbs +2 -0
- data/sig/lithic/internal/type/union.rbs +2 -0
- data/sig/lithic/internal/util.rbs +2 -0
- data/sig/lithic/internal.rbs +1 -1
- metadata +4 -2
@@ -13,6 +13,10 @@ module Lithic
|
|
13
13
|
class ArrayOf
|
14
14
|
include Lithic::Internal::Type::Converter
|
15
15
|
|
16
|
+
private_class_method :new
|
17
|
+
|
18
|
+
# @overload [](type_info, spec = {})
|
19
|
+
#
|
16
20
|
# @param type_info [Hash{Symbol=>Object}, Proc, Lithic::Internal::Type::Converter, Class]
|
17
21
|
#
|
18
22
|
# @param spec [Hash{Symbol=>Object}] .
|
@@ -24,7 +28,7 @@ module Lithic
|
|
24
28
|
# @option spec [Proc] :union
|
25
29
|
#
|
26
30
|
# @option spec [Boolean] :"nil?"
|
27
|
-
def self.[](
|
31
|
+
def self.[](...) = new(...)
|
28
32
|
|
29
33
|
# @param other [Object]
|
30
34
|
#
|
@@ -120,7 +124,18 @@ module Lithic
|
|
120
124
|
# @option spec [Boolean] :"nil?"
|
121
125
|
def initialize(type_info, spec = {})
|
122
126
|
@item_type_fn = Lithic::Internal::Type::Converter.type_info(type_info || spec)
|
123
|
-
@nilable = spec
|
127
|
+
@nilable = spec.fetch(:nil?, false)
|
128
|
+
end
|
129
|
+
|
130
|
+
# @api private
|
131
|
+
#
|
132
|
+
# @param depth [Integer]
|
133
|
+
#
|
134
|
+
# @return [String]
|
135
|
+
def inspect(depth: 0)
|
136
|
+
items = Lithic::Internal::Type::Converter.inspect(item_type, depth: depth.succ)
|
137
|
+
|
138
|
+
"#{self.class}[#{[items, nilable? ? 'nil' : nil].compact.join(' | ')}]"
|
124
139
|
end
|
125
140
|
end
|
126
141
|
end
|
@@ -63,7 +63,7 @@ module Lithic
|
|
63
63
|
|
64
64
|
setter = "#{name_sym}="
|
65
65
|
api_name = info.fetch(:api_name, name_sym)
|
66
|
-
nilable = info
|
66
|
+
nilable = info.fetch(:nil?, false)
|
67
67
|
const = required && !nilable ? info.fetch(:const, Lithic::Internal::OMIT) : Lithic::Internal::OMIT
|
68
68
|
|
69
69
|
[name_sym, setter].each { undef_method(_1) } if known_fields.key?(name_sym)
|
@@ -361,14 +361,42 @@ module Lithic
|
|
361
361
|
end
|
362
362
|
end
|
363
363
|
|
364
|
+
class << self
|
365
|
+
# @api private
|
366
|
+
#
|
367
|
+
# @param depth [Integer]
|
368
|
+
#
|
369
|
+
# @return [String]
|
370
|
+
def inspect(depth: 0)
|
371
|
+
return super() if depth.positive?
|
372
|
+
|
373
|
+
depth = depth.succ
|
374
|
+
deferred = fields.transform_values do |field|
|
375
|
+
type, required, nilable = field.fetch_values(:type, :required, :nilable)
|
376
|
+
-> do
|
377
|
+
[
|
378
|
+
Lithic::Internal::Type::Converter.inspect(type, depth: depth),
|
379
|
+
!required || nilable ? "nil" : nil
|
380
|
+
].compact.join(" | ")
|
381
|
+
end
|
382
|
+
.tap { _1.define_singleton_method(:inspect) { call } }
|
383
|
+
end
|
384
|
+
|
385
|
+
"#{name}[#{deferred.inspect}]"
|
386
|
+
end
|
387
|
+
end
|
388
|
+
|
389
|
+
# @api private
|
390
|
+
#
|
364
391
|
# @return [String]
|
365
392
|
def inspect
|
366
|
-
rows =
|
367
|
-
"#{_1}=#{
|
393
|
+
rows = @data.map do
|
394
|
+
"#{_1}=#{self.class.known_fields.key?(_1) ? public_send(_1).inspect : ''}"
|
368
395
|
rescue Lithic::Errors::ConversionError
|
369
|
-
"#{_1}=#{
|
396
|
+
"#{_1}=#{_2.inspect}"
|
370
397
|
end
|
371
|
-
|
398
|
+
|
399
|
+
"#<#{self.class}:0x#{object_id.to_s(16)} #{rows.join(' ')}>"
|
372
400
|
end
|
373
401
|
end
|
374
402
|
end
|
@@ -49,6 +49,15 @@ module Lithic
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
# @api private
|
53
|
+
#
|
54
|
+
# @param depth [Integer]
|
55
|
+
#
|
56
|
+
# @return [String]
|
57
|
+
def inspect(depth: 0)
|
58
|
+
super()
|
59
|
+
end
|
60
|
+
|
52
61
|
# rubocop:enable Lint/UnusedMethodArgument
|
53
62
|
|
54
63
|
class << self
|
@@ -240,6 +249,21 @@ module Lithic
|
|
240
249
|
Lithic::Internal::Type::Unknown.dump(value, state: state)
|
241
250
|
end
|
242
251
|
end
|
252
|
+
|
253
|
+
# @api private
|
254
|
+
#
|
255
|
+
# @param target [Object]
|
256
|
+
# @param depth [Integer]
|
257
|
+
#
|
258
|
+
# @return [String]
|
259
|
+
def inspect(target, depth:)
|
260
|
+
case target
|
261
|
+
in Lithic::Internal::Type::Converter
|
262
|
+
target.inspect(depth: depth.succ)
|
263
|
+
else
|
264
|
+
target.inspect
|
265
|
+
end
|
266
|
+
end
|
243
267
|
end
|
244
268
|
end
|
245
269
|
end
|
@@ -58,9 +58,9 @@ module Lithic
|
|
58
58
|
#
|
59
59
|
# @return [Boolean]
|
60
60
|
def ==(other)
|
61
|
-
# rubocop:disable
|
62
|
-
|
63
|
-
# rubocop:enable
|
61
|
+
# rubocop:disable Style/CaseEquality
|
62
|
+
Lithic::Internal::Type::Enum === other && other.values.to_set == values.to_set
|
63
|
+
# rubocop:enable Style/CaseEquality
|
64
64
|
end
|
65
65
|
|
66
66
|
# @api private
|
@@ -103,6 +103,22 @@ module Lithic
|
|
103
103
|
# #
|
104
104
|
# # @return [Symbol, Object]
|
105
105
|
# def dump(value, state:) = super
|
106
|
+
|
107
|
+
# @api private
|
108
|
+
#
|
109
|
+
# @param depth [Integer]
|
110
|
+
#
|
111
|
+
# @return [String]
|
112
|
+
def inspect(depth: 0)
|
113
|
+
if depth.positive?
|
114
|
+
return is_a?(Module) ? super() : self.class.name
|
115
|
+
end
|
116
|
+
|
117
|
+
members = values.map { Lithic::Internal::Type::Converter.inspect(_1, depth: depth.succ) }
|
118
|
+
prefix = is_a?(Module) ? name : self.class.name
|
119
|
+
|
120
|
+
"#{prefix}[#{members.join(' | ')}]"
|
121
|
+
end
|
106
122
|
end
|
107
123
|
end
|
108
124
|
end
|
@@ -13,6 +13,10 @@ module Lithic
|
|
13
13
|
class HashOf
|
14
14
|
include Lithic::Internal::Type::Converter
|
15
15
|
|
16
|
+
private_class_method :new
|
17
|
+
|
18
|
+
# @overload [](type_info, spec = {})
|
19
|
+
#
|
16
20
|
# @param type_info [Hash{Symbol=>Object}, Proc, Lithic::Internal::Type::Converter, Class]
|
17
21
|
#
|
18
22
|
# @param spec [Hash{Symbol=>Object}] .
|
@@ -24,7 +28,7 @@ module Lithic
|
|
24
28
|
# @option spec [Proc] :union
|
25
29
|
#
|
26
30
|
# @option spec [Boolean] :"nil?"
|
27
|
-
def self.[](
|
31
|
+
def self.[](...) = new(...)
|
28
32
|
|
29
33
|
# @param other [Object]
|
30
34
|
#
|
@@ -140,7 +144,18 @@ module Lithic
|
|
140
144
|
# @option spec [Boolean] :"nil?"
|
141
145
|
def initialize(type_info, spec = {})
|
142
146
|
@item_type_fn = Lithic::Internal::Type::Converter.type_info(type_info || spec)
|
143
|
-
@nilable = spec
|
147
|
+
@nilable = spec.fetch(:nil?, false)
|
148
|
+
end
|
149
|
+
|
150
|
+
# @api private
|
151
|
+
#
|
152
|
+
# @param depth [Integer]
|
153
|
+
#
|
154
|
+
# @return [String]
|
155
|
+
def inspect(depth: 0)
|
156
|
+
items = Lithic::Internal::Type::Converter.inspect(item_type, depth: depth.succ)
|
157
|
+
|
158
|
+
"#{self.class}[#{[items, nilable? ? 'nil' : nil].compact.join(' | ')}]"
|
144
159
|
end
|
145
160
|
end
|
146
161
|
end
|
@@ -111,9 +111,7 @@ module Lithic
|
|
111
111
|
#
|
112
112
|
# @return [Boolean]
|
113
113
|
def ==(other)
|
114
|
-
|
115
|
-
other.is_a?(Module) && other.singleton_class <= Lithic::Internal::Type::Union && other.derefed_variants == derefed_variants
|
116
|
-
# rubocop:enable Layout/LineLength
|
114
|
+
Lithic::Internal::Type::Union === other && other.derefed_variants == derefed_variants
|
117
115
|
end
|
118
116
|
|
119
117
|
# @api private
|
@@ -196,6 +194,22 @@ module Lithic
|
|
196
194
|
|
197
195
|
# rubocop:enable Style/CaseEquality
|
198
196
|
# rubocop:enable Style/HashEachMethods
|
197
|
+
|
198
|
+
# @api private
|
199
|
+
#
|
200
|
+
# @param depth [Integer]
|
201
|
+
#
|
202
|
+
# @return [String]
|
203
|
+
def inspect(depth: 0)
|
204
|
+
if depth.positive?
|
205
|
+
return is_a?(Module) ? super() : self.class.name
|
206
|
+
end
|
207
|
+
|
208
|
+
members = variants.map { Lithic::Internal::Type::Converter.inspect(_1, depth: depth.succ) }
|
209
|
+
prefix = is_a?(Module) ? name : self.class.name
|
210
|
+
|
211
|
+
"#{prefix}[#{members.join(' | ')}]"
|
212
|
+
end
|
199
213
|
end
|
200
214
|
end
|
201
215
|
end
|
data/lib/lithic/internal/util.rb
CHANGED
@@ -448,7 +448,7 @@ module Lithic
|
|
448
448
|
else
|
449
449
|
src
|
450
450
|
end
|
451
|
-
@buf = String.new
|
451
|
+
@buf = String.new
|
452
452
|
@blk = blk
|
453
453
|
end
|
454
454
|
end
|
@@ -460,7 +460,7 @@ module Lithic
|
|
460
460
|
# @return [Enumerable<String>]
|
461
461
|
def writable_enum(&blk)
|
462
462
|
Enumerator.new do |y|
|
463
|
-
buf = String.new
|
463
|
+
buf = String.new
|
464
464
|
y.define_singleton_method(:write) do
|
465
465
|
self << buf.replace(_1)
|
466
466
|
buf.bytesize
|
@@ -582,6 +582,27 @@ module Lithic
|
|
582
582
|
|
583
583
|
# @api private
|
584
584
|
#
|
585
|
+
# https://www.iana.org/assignments/character-sets/character-sets.xhtml
|
586
|
+
#
|
587
|
+
# @param content_type [String]
|
588
|
+
# @param text [String]
|
589
|
+
def force_charset!(content_type, text:)
|
590
|
+
charset = /charset=([^;\s]+)/.match(content_type)&.captures&.first
|
591
|
+
|
592
|
+
return unless charset
|
593
|
+
|
594
|
+
begin
|
595
|
+
encoding = Encoding.find(charset)
|
596
|
+
text.force_encoding(encoding)
|
597
|
+
rescue ArgumentError
|
598
|
+
nil
|
599
|
+
end
|
600
|
+
end
|
601
|
+
|
602
|
+
# @api private
|
603
|
+
#
|
604
|
+
# Assumes each chunk in stream has `Encoding::BINARY`.
|
605
|
+
#
|
585
606
|
# @param headers [Hash{String=>String}, Net::HTTPHeader]
|
586
607
|
# @param stream [Enumerable<String>]
|
587
608
|
# @param suppress_error [Boolean]
|
@@ -589,7 +610,7 @@ module Lithic
|
|
589
610
|
# @raise [JSON::ParserError]
|
590
611
|
# @return [Object]
|
591
612
|
def decode_content(headers, stream:, suppress_error: false)
|
592
|
-
case headers["content-type"]
|
613
|
+
case (content_type = headers["content-type"])
|
593
614
|
in %r{^application/(?:vnd\.api\+)?json}
|
594
615
|
json = stream.to_a.join
|
595
616
|
begin
|
@@ -606,11 +627,10 @@ module Lithic
|
|
606
627
|
in %r{^text/event-stream}
|
607
628
|
lines = decode_lines(stream)
|
608
629
|
decode_sse(lines)
|
609
|
-
in %r{^text/}
|
610
|
-
stream.to_a.join
|
611
630
|
else
|
612
|
-
|
613
|
-
|
631
|
+
text = stream.to_a.join
|
632
|
+
force_charset!(content_type, text: text)
|
633
|
+
StringIO.new(text)
|
614
634
|
end
|
615
635
|
end
|
616
636
|
end
|
@@ -675,12 +695,17 @@ module Lithic
|
|
675
695
|
class << self
|
676
696
|
# @api private
|
677
697
|
#
|
698
|
+
# Assumes Strings have been forced into having `Encoding::BINARY`.
|
699
|
+
#
|
700
|
+
# This decoder is responsible for reassembling lines split across multiple
|
701
|
+
# fragments.
|
702
|
+
#
|
678
703
|
# @param enum [Enumerable<String>]
|
679
704
|
#
|
680
705
|
# @return [Enumerable<String>]
|
681
706
|
def decode_lines(enum)
|
682
707
|
re = /(\r\n|\r|\n)/
|
683
|
-
buffer = String.new
|
708
|
+
buffer = String.new
|
684
709
|
cr_seen = nil
|
685
710
|
|
686
711
|
chain_fused(enum) do |y|
|
@@ -711,6 +736,8 @@ module Lithic
|
|
711
736
|
#
|
712
737
|
# https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream
|
713
738
|
#
|
739
|
+
# Assumes that `lines` has been decoded with `#decode_lines`.
|
740
|
+
#
|
714
741
|
# @param lines [Enumerable<String>]
|
715
742
|
#
|
716
743
|
# @return [Enumerable<Hash{Symbol=>Object}>]
|
@@ -734,7 +761,7 @@ module Lithic
|
|
734
761
|
in "event"
|
735
762
|
current.merge!(event: value)
|
736
763
|
in "data"
|
737
|
-
(current[:data] ||= String.new
|
764
|
+
(current[:data] ||= String.new) << (value << "\n")
|
738
765
|
in "id" unless value.include?("\0")
|
739
766
|
current.merge!(id: value)
|
740
767
|
in "retry" if /^\d+$/ =~ value
|
data/lib/lithic/internal.rb
CHANGED
data/lib/lithic/version.rb
CHANGED
data/rbi/lib/lithic/client.rbi
CHANGED
@@ -128,8 +128,9 @@ module Lithic
|
|
128
128
|
# - `production` corresponds to `https://api.lithic.com`
|
129
129
|
# - `sandbox` corresponds to `https://sandbox.lithic.com`
|
130
130
|
environment: nil,
|
131
|
-
# Override the default base URL for the API, e.g.,
|
132
|
-
|
131
|
+
# Override the default base URL for the API, e.g.,
|
132
|
+
# `"https://api.example.com/v2/"`. Defaults to `ENV["LITHIC_BASE_URL"]`
|
133
|
+
base_url: ENV["LITHIC_BASE_URL"],
|
133
134
|
# Max number of retries to attempt after a failed retryable request.
|
134
135
|
max_retries: DEFAULT_MAX_RETRIES,
|
135
136
|
timeout: DEFAULT_TIMEOUT_IN_SECONDS,
|
@@ -10,11 +10,10 @@ module Lithic
|
|
10
10
|
include Lithic::Internal::Type::Converter
|
11
11
|
|
12
12
|
abstract!
|
13
|
-
final!
|
14
13
|
|
15
14
|
Elem = type_member(:out)
|
16
15
|
|
17
|
-
sig
|
16
|
+
sig do
|
18
17
|
params(
|
19
18
|
type_info: T.any(
|
20
19
|
Lithic::Internal::AnyHash,
|
@@ -27,14 +26,14 @@ module Lithic
|
|
27
26
|
end
|
28
27
|
def self.[](type_info, spec = {}); end
|
29
28
|
|
30
|
-
sig
|
29
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
31
30
|
def ===(other); end
|
32
31
|
|
33
|
-
sig
|
32
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
34
33
|
def ==(other); end
|
35
34
|
|
36
35
|
# @api private
|
37
|
-
sig
|
36
|
+
sig do
|
38
37
|
override
|
39
38
|
.params(
|
40
39
|
value: T.any(T::Array[T.anything], T.anything),
|
@@ -45,7 +44,7 @@ module Lithic
|
|
45
44
|
def coerce(value, state:); end
|
46
45
|
|
47
46
|
# @api private
|
48
|
-
sig
|
47
|
+
sig do
|
49
48
|
override
|
50
49
|
.params(
|
51
50
|
value: T.any(T::Array[T.anything], T.anything),
|
@@ -56,15 +55,15 @@ module Lithic
|
|
56
55
|
def dump(value, state:); end
|
57
56
|
|
58
57
|
# @api private
|
59
|
-
sig
|
58
|
+
sig { returns(Elem) }
|
60
59
|
protected def item_type; end
|
61
60
|
|
62
61
|
# @api private
|
63
|
-
sig
|
62
|
+
sig { returns(T::Boolean) }
|
64
63
|
protected def nilable?; end
|
65
64
|
|
66
65
|
# @api private
|
67
|
-
sig
|
66
|
+
sig do
|
68
67
|
params(
|
69
68
|
type_info: T.any(
|
70
69
|
Lithic::Internal::AnyHash,
|
@@ -76,6 +75,10 @@ module Lithic
|
|
76
75
|
.void
|
77
76
|
end
|
78
77
|
def initialize(type_info, spec = {}); end
|
78
|
+
|
79
|
+
# @api private
|
80
|
+
sig { params(depth: Integer).returns(String) }
|
81
|
+
def inspect(depth: 0); end
|
79
82
|
end
|
80
83
|
end
|
81
84
|
end
|
@@ -185,6 +185,13 @@ module Lithic
|
|
185
185
|
sig { params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns(T.attached_class) }
|
186
186
|
def self.new(data = {}); end
|
187
187
|
|
188
|
+
class << self
|
189
|
+
# @api private
|
190
|
+
sig { params(depth: Integer).returns(String) }
|
191
|
+
def inspect(depth: 0); end
|
192
|
+
end
|
193
|
+
|
194
|
+
# @api private
|
188
195
|
sig { returns(String) }
|
189
196
|
def inspect; end
|
190
197
|
end
|
@@ -10,17 +10,16 @@ module Lithic
|
|
10
10
|
extend Lithic::Internal::Type::Converter
|
11
11
|
|
12
12
|
abstract!
|
13
|
-
final!
|
14
13
|
|
15
|
-
sig
|
14
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
16
15
|
def self.===(other); end
|
17
16
|
|
18
|
-
sig
|
17
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
19
18
|
def self.==(other); end
|
20
19
|
|
21
20
|
class << self
|
22
21
|
# @api private
|
23
|
-
sig
|
22
|
+
sig do
|
24
23
|
override
|
25
24
|
.params(value: T.any(
|
26
25
|
T::Boolean,
|
@@ -32,7 +31,7 @@ module Lithic
|
|
32
31
|
def coerce(value, state:); end
|
33
32
|
|
34
33
|
# @api private
|
35
|
-
sig
|
34
|
+
sig do
|
36
35
|
override
|
37
36
|
.params(value: T.any(
|
38
37
|
T::Boolean,
|
@@ -34,6 +34,10 @@ module Lithic
|
|
34
34
|
end
|
35
35
|
def dump(value, state:); end
|
36
36
|
|
37
|
+
# @api private
|
38
|
+
sig { params(depth: Integer).returns(String) }
|
39
|
+
def inspect(depth: 0); end
|
40
|
+
|
37
41
|
class << self
|
38
42
|
# @api private
|
39
43
|
sig do
|
@@ -105,6 +109,10 @@ module Lithic
|
|
105
109
|
.returns(T.anything)
|
106
110
|
end
|
107
111
|
def self.dump(target, value, state: {can_retry: true}); end
|
112
|
+
|
113
|
+
# @api private
|
114
|
+
sig { params(target: T.anything, depth: Integer).returns(String) }
|
115
|
+
def self.inspect(target, depth:); end
|
108
116
|
end
|
109
117
|
end
|
110
118
|
end
|
@@ -10,11 +10,10 @@ module Lithic
|
|
10
10
|
include Lithic::Internal::Type::Converter
|
11
11
|
|
12
12
|
abstract!
|
13
|
-
final!
|
14
13
|
|
15
14
|
Elem = type_member(:out)
|
16
15
|
|
17
|
-
sig
|
16
|
+
sig do
|
18
17
|
params(
|
19
18
|
type_info: T.any(
|
20
19
|
Lithic::Internal::AnyHash,
|
@@ -27,14 +26,14 @@ module Lithic
|
|
27
26
|
end
|
28
27
|
def self.[](type_info, spec = {}); end
|
29
28
|
|
30
|
-
sig
|
29
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
31
30
|
def ===(other); end
|
32
31
|
|
33
|
-
sig
|
32
|
+
sig { params(other: T.anything).returns(T::Boolean) }
|
34
33
|
def ==(other); end
|
35
34
|
|
36
35
|
# @api private
|
37
|
-
sig
|
36
|
+
sig do
|
38
37
|
override
|
39
38
|
.params(
|
40
39
|
value: T.any(T::Hash[T.anything, T.anything], T.anything),
|
@@ -45,7 +44,7 @@ module Lithic
|
|
45
44
|
def coerce(value, state:); end
|
46
45
|
|
47
46
|
# @api private
|
48
|
-
sig
|
47
|
+
sig do
|
49
48
|
override
|
50
49
|
.params(
|
51
50
|
value: T.any(T::Hash[T.anything, T.anything], T.anything),
|
@@ -56,15 +55,15 @@ module Lithic
|
|
56
55
|
def dump(value, state:); end
|
57
56
|
|
58
57
|
# @api private
|
59
|
-
sig
|
58
|
+
sig { returns(Elem) }
|
60
59
|
protected def item_type; end
|
61
60
|
|
62
61
|
# @api private
|
63
|
-
sig
|
62
|
+
sig { returns(T::Boolean) }
|
64
63
|
protected def nilable?; end
|
65
64
|
|
66
65
|
# @api private
|
67
|
-
sig
|
66
|
+
sig do
|
68
67
|
params(
|
69
68
|
type_info: T.any(
|
70
69
|
Lithic::Internal::AnyHash,
|
@@ -76,6 +75,10 @@ module Lithic
|
|
76
75
|
.void
|
77
76
|
end
|
78
77
|
def initialize(type_info, spec = {}); end
|
78
|
+
|
79
|
+
# @api private
|
80
|
+
sig { params(depth: Integer).returns(String) }
|
81
|
+
def inspect(depth: 0); end
|
79
82
|
end
|
80
83
|
end
|
81
84
|
end
|