sorbet-runtime 0.5.11422 → 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: a675bfbf51b32916be960aadcc1411329f21729d5ceb2218509da82d20387ddd
4
- data.tar.gz: a39ec7df0cf067c2c31d22f557caea810c37c4985c1437a28e03b5db72036c0b
3
+ metadata.gz: b2960526ca5c8aa726786363e429507cfda773339d8d40016c628c3babfb23c6
4
+ data.tar.gz: 2c93074767042b3378af024700ac091e9a969d1241c72040d2ef63774ff02559
5
5
  SHA512:
6
- metadata.gz: dab2fb9c543e4eb0c652446435ad9c7a41d3850a3a2eefda6fc25a64181cbbe8a027e7313f37eea42c1bc14771be5bd6ff2799b4589668d43c4d1a3f91840953
7
- data.tar.gz: '09c74373b54c24f90a63106bc726ab4fb66d61dca523bb4323effc9072bf08162135b52deb3ad648b31be156ccd609f907efc30015a5bac3b14f83f5d53bf384'
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.11422
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-08 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