sorbet-runtime 0.5.10616 → 0.5.10624
Sign up to get free protection for your applications and to get access to all the features.
- 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: 4082eed81cede498862d3f4921014d54c888e3debc92086e5661bcc8151dd135
|
4
|
+
data.tar.gz: 54825f8b737aad3404a2da1ac9c1be07c468a6e9457b1cc700444a9c22b13cf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a32e163b814ab0b1704f9ec0cef9bcd7a45da1f0d27a0e1c67fafce2b77522cb56272db08e5f4c59c5b55af1f6f2bc1ba200e20e742e276761a297a13ab32ef
|
7
|
+
data.tar.gz: 856a4f079e2fc8714876704eca6436ba7fee2de5e5d64775827aca0f839eb4d634f29f55972d9b6efbd197bca090d8a36fc3acb86502da25c03470c4ee69e355
|
@@ -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.10624
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|