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 +4 -4
- data/lib/types/props/_props.rb +5 -5
- data/lib/types/struct.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2960526ca5c8aa726786363e429507cfda773339d8d40016c628c3babfb23c6
|
4
|
+
data.tar.gz: 2c93074767042b3378af024700ac091e9a969d1241c72040d2ef63774ff02559
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 476ec982ac40cea9cb9fed21577e14e3d42d7a7e133d155199f233af0f5f2e036f3c05eea5d66cd07eeaee7f8f0a022bfd64961a893bec4b33d8193efbabe8f2
|
7
|
+
data.tar.gz: 2fd4c5a4e4848cf95e4de8c3040c445c11d1445f0ba4de8f05d79955d5056708a6720f2bab751ef96fc2746d20febab5d2cdf1933cc2db63c2b5d0500f55ecd8
|
data/lib/types/props/_props.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|