sorbet-runtime 0.5.11418 → 0.5.11428

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: 9d47e0855069a52cddb76f8dd0db9459d6075ef29cbfe963f827c23b83d72845
4
- data.tar.gz: 575a4903ff3f64dbeb314e255d97ea9765ebb1d577b4ad1552c2d6594a9f2ca4
3
+ metadata.gz: b2960526ca5c8aa726786363e429507cfda773339d8d40016c628c3babfb23c6
4
+ data.tar.gz: 2c93074767042b3378af024700ac091e9a969d1241c72040d2ef63774ff02559
5
5
  SHA512:
6
- metadata.gz: f5bf64bd095842688194de3da7a6d1f06c1cb218dd55bce00b06ea2cd9fddff64fac25f1f409f4773425a28b6c4c45b38d02b3d89f3befdf373c925f52448e03
7
- data.tar.gz: 4b58fdfb9eb679910588c2e93200b9a69096c5cf021947e8e24d5b1a11253cda08891a9170b5488bcbf5681d7845d7df09a49f7908176d4e1ef5fb7195d33e83
6
+ metadata.gz: 476ec982ac40cea9cb9fed21577e14e3d42d7a7e133d155199f233af0f5f2e036f3c05eea5d66cd07eeaee7f8f0a022bfd64961a893bec4b33d8193efbabe8f2
7
+ data.tar.gz: 2fd4c5a4e4848cf95e4de8c3040c445c11d1445f0ba4de8f05d79955d5056708a6720f2bab751ef96fc2746d20febab5d2cdf1933cc2db63c2b5d0500f55ecd8
@@ -110,7 +110,7 @@ module T::Props
110
110
  #
111
111
  # @return [void]
112
112
  sig {params(name: Symbol, cls: T.untyped, rules: T.untyped).void}
113
- def prop(name, cls, rules={})
113
+ def prop(name, cls, **rules)
114
114
  cls = T::Utils.coerce(cls) if !cls.is_a?(Module)
115
115
  decorator.prop_defined(name, cls, rules)
116
116
  end
@@ -132,16 +132,16 @@ module T::Props
132
132
  end
133
133
 
134
134
  # Shorthand helper to define a `prop` with `immutable => true`
135
- sig {params(name: Symbol, cls_or_args: T.untyped, args: T::Hash[Symbol, T.untyped]).void}
136
- def const(name, cls_or_args, args={})
135
+ sig {params(name: Symbol, cls_or_args: T.untyped, args: T.untyped).void}
136
+ def const(name, cls_or_args, **args)
137
137
  if (cls_or_args.is_a?(Hash) && cls_or_args.key?(:immutable)) || args.key?(:immutable)
138
138
  Kernel.raise ArgumentError.new("Cannot pass 'immutable' argument when using 'const' keyword to define a prop")
139
139
  end
140
140
 
141
141
  if cls_or_args.is_a?(Hash)
142
- self.prop(name, cls_or_args.merge(immutable: true))
142
+ self.prop(name, **cls_or_args.merge(immutable: true))
143
143
  else
144
- self.prop(name, cls_or_args, args.merge(immutable: true))
144
+ self.prop(name, cls_or_args, **args.merge(immutable: true))
145
145
  end
146
146
  end
147
147
 
data/lib/types/struct.rb CHANGED
@@ -39,7 +39,7 @@ class T::ImmutableStruct < T::InexactStruct
39
39
 
40
40
  # Matches the signature in Props, but raises since this is an immutable struct and only const is allowed
41
41
  sig {params(name: Symbol, cls: T.untyped, rules: T.untyped).void}
42
- def self.prop(name, cls, rules={})
42
+ def self.prop(name, cls, **rules)
43
43
  return super if (cls.is_a?(Hash) && cls[:immutable]) || rules[:immutable]
44
44
 
45
45
  raise "Cannot use `prop` in #{self.name} because it is an immutable struct. Use `const` instead"
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.11418
4
+ version: 0.5.11428
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-07 00:00:00.000000000 Z
11
+ date: 2024-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest