sorbet-runtime 0.5.10616 → 0.5.10621
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/lib/types/private/methods/decl_builder.rb +16 -2
- 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: a6eb4950eaf0dcb0f10347e115ca43120227f648f90bf337cd4d20edd63f36f1
|
4
|
+
data.tar.gz: b8d4027e929cf655b27d18c1434afad2933a3b08f4a6f1fdfca9f3b421d0c99c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2cb612010cb3c836ac8f02e1a8cb6d7e75df6c955e1da16e8d34c56fa05d924cb12f12cffe52d571e289395e173c9bcf9ba96e704bc590bb79a0f67866ed7bc
|
7
|
+
data.tar.gz: 60d233ec5d2b1efd1c6774d79b670f48ff01c2e15af4c580d594aaf95ff07cbe16b0432d2f211f033353a27de9c18d74b34b36a503fd67322fe9320682982a06
|
@@ -32,15 +32,29 @@ module T::Private::Methods
|
|
32
32
|
)
|
33
33
|
end
|
34
34
|
|
35
|
-
def params(**params)
|
35
|
+
def params(*unused_positional_params, **params)
|
36
36
|
check_live!
|
37
37
|
if !decl.params.equal?(ARG_NOT_PROVIDED)
|
38
38
|
raise BuilderError.new("You can't call .params twice")
|
39
39
|
end
|
40
40
|
|
41
|
+
if unused_positional_params.any?
|
42
|
+
some_or_only = params.any? ? "some" : "only"
|
43
|
+
raise BuilderError.new(<<~MSG)
|
44
|
+
'params' was called with #{some_or_only} positional arguments, but it needs to be called with keyword arguments.
|
45
|
+
The keyword arguments' keys must match the name and order of the method's parameters.
|
46
|
+
MSG
|
47
|
+
end
|
48
|
+
|
41
49
|
if params.empty?
|
42
|
-
raise BuilderError.new(
|
50
|
+
raise BuilderError.new(<<~MSG)
|
51
|
+
'params' was called without any arguments, but it needs to be called with keyword arguments.
|
52
|
+
The keyword arguments' keys must match the name and order of the method's parameters.
|
53
|
+
|
54
|
+
Omit 'params' entirely for methods with no parameters.
|
55
|
+
MSG
|
43
56
|
end
|
57
|
+
|
44
58
|
decl.params = params
|
45
59
|
|
46
60
|
self
|
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.10621
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|