sorbet-runtime 0.5.10001 → 0.5.10145

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6288827de940cd209a4e71c152e20fda7e5e135aca0e95180458218c67b2fd6e
4
- data.tar.gz: 5f1a5486df960e88721af1557e506d58305ee5c1f074fe78a73b5a51eadfd2f0
3
+ metadata.gz: 217d5b4fc130455728dac398f56d7f6b144996924f2a335a20c00de526fd6a35
4
+ data.tar.gz: 1e058baf05423999a38a7e8014a2051c609e5182c304bdf2e495061ec48046a5
5
5
  SHA512:
6
- metadata.gz: 27bd61480ceceb466aa3d5673d60e3040dab531d26f17f32e65b9fbac9d0160f3e8bd45a637177e3d412e2b202410152ec12d72886eb58d2bc7fd70621a1c58f
7
- data.tar.gz: 8f6674e0a5a8b57d8b4206361d3602137b39deb63f7941ccae63f93f356b2074e1efc1f91648c024b47725b1fa9ce6670719660a34b7812f8d536362d9400388
6
+ metadata.gz: 0b5c14d228c770c27ffeec068cf58fe3406a6f90842ebdd0e1d368c84e3eb89c41182f38993734776bd41b7554f90f22a8a4e3c6b1421f3e480c06698c1b7971
7
+ data.tar.gz: e614316aa100caacea13cc132ce5b10a62e4c28f224cd3e0a56c4051157d0020d664a9cd9a09dee19f595ce3cb55851d3051d7dff7fdc9f4448de1f2afddec92
data/lib/types/enum.rb CHANGED
@@ -158,6 +158,13 @@ class T::Enum
158
158
  serialize.to_json(*args)
159
159
  end
160
160
 
161
+ sig {params(args: T.untyped).returns(T.untyped)}
162
+ def as_json(*args)
163
+ serialized_val = serialize
164
+ return serialized_val unless serialized_val.respond_to?(:as_json)
165
+ serialized_val.as_json(*args)
166
+ end
167
+
161
168
  sig {returns(String)}
162
169
  def to_s
163
170
  inspect
@@ -281,7 +288,7 @@ class T::Enum
281
288
  # Historical note: We convert to lowercase names because the majority of existing calls to
282
289
  # `make_accessible` were arrays of lowercase strings. Doing this conversion allowed for the
283
290
  # least amount of repetition in migrated declarations.
284
- const_name.to_s.downcase.freeze
291
+ -const_name.to_s.downcase.freeze
285
292
  end
286
293
 
287
294
  sig {returns(T::Boolean)}
data/lib/types/helpers.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # typed: true
3
3
 
4
4
  # Use as a mixin with extend (`extend T::Helpers`).
5
- # Docs at https://confluence.corp.stripe.com/display/PRODINFRA/Ruby+Types
5
+ # Docs at https://sorbet.org/docs/
6
6
  module T::Helpers
7
7
  extend T::Sig
8
8
 
@@ -58,6 +58,14 @@ class T::Props::Decorator
58
58
  @props = @props.merge(prop => rules.freeze).freeze
59
59
  end
60
60
 
61
+ # Heads up!
62
+ #
63
+ # There are already too many ad-hoc options on the prop DSL.
64
+ #
65
+ # We have already done a lot of work to remove unnecessary and confusing
66
+ # options. If you're considering adding a new rule key, please come chat with
67
+ # the Sorbet team first, as we'd really like to learn more about how to best
68
+ # solve the problem you're encountering.
61
69
  VALID_RULE_KEYS = T.let(%i[
62
70
  enum
63
71
  foreign
@@ -12,6 +12,14 @@ end
12
12
  module T::Props::Optional::DecoratorMethods
13
13
  extend T::Sig
14
14
 
15
+ # Heads up!
16
+ #
17
+ # There are already too many ad-hoc options on the prop DSL.
18
+ #
19
+ # We have already done a lot of work to remove unnecessary and confusing
20
+ # options. If you're considering adding a new rule key, please come chat with
21
+ # the Sorbet team first, as we'd really like to learn more about how to best
22
+ # solve the problem you're encountering.
15
23
  VALID_RULE_KEYS = {
16
24
  default: true,
17
25
  factory: true,
@@ -179,6 +179,14 @@ end
179
179
  module T::Props::Serializable::DecoratorMethods
180
180
  include T::Props::HasLazilySpecializedMethods::DecoratorMethods
181
181
 
182
+ # Heads up!
183
+ #
184
+ # There are already too many ad-hoc options on the prop DSL.
185
+ #
186
+ # We have already done a lot of work to remove unnecessary and confusing
187
+ # options. If you're considering adding a new rule key, please come chat with
188
+ # the Sorbet team first, as we'd really like to learn more about how to best
189
+ # solve the problem you're encountering.
182
190
  VALID_RULE_KEYS = {dont_store: true, name: true, raise_on_nil_write: true}.freeze
183
191
  private_constant :VALID_RULE_KEYS
184
192
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10001
4
+ version: 0.5.10145
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-12 00:00:00.000000000 Z
11
+ date: 2022-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest