sorbet-runtime 0.5.5585 → 0.5.5605
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/props/custom_type.rb +1 -1
- data/lib/types/props/decorator.rb +15 -0
- data/lib/types/props/serializable.rb +3 -3
- 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: 66ba8970744bbc8b5c86620d2fc977eece596d415193756dfb0eddb37239dfab
|
4
|
+
data.tar.gz: 2f0db92930464840cae2856a6891d492d6786dc2fa834ba3fada3930ae060084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61c82fc9660915ae371726bde8d9fe0e937e45c1abc7febe2d0939902408dc780f725edcb6c709e88d4ef46f73a29a18b3140013250a25d6aaa2513423dec22f
|
7
|
+
data.tar.gz: c75832d08785af77214c2235be9d6c3f0f8963c0d69cf469502377c7dc9bec5baad5d0919ede43124e4c2f31fe594f940c04bf944c12025c84209ceb81e8192c
|
@@ -119,6 +119,21 @@ class T::Props::Decorator
|
|
119
119
|
end
|
120
120
|
alias_method :set, :prop_set
|
121
121
|
|
122
|
+
# Only Models have any custom get logic but we need to call this on
|
123
|
+
# non-Models since we don't know at code gen time what we have.
|
124
|
+
sig do
|
125
|
+
params(
|
126
|
+
instance: DecoratedInstance,
|
127
|
+
prop: Symbol,
|
128
|
+
value: T.untyped
|
129
|
+
)
|
130
|
+
.returns(T.untyped)
|
131
|
+
.checked(:never)
|
132
|
+
end
|
133
|
+
def prop_get_logic(instance, prop, value)
|
134
|
+
value
|
135
|
+
end
|
136
|
+
|
122
137
|
# For performance, don't use named params here.
|
123
138
|
# Passing in rules here is purely a performance optimization.
|
124
139
|
#
|
@@ -25,7 +25,7 @@ module T::Props::Serializable
|
|
25
25
|
:generate_serialize_source
|
26
26
|
)
|
27
27
|
if msg
|
28
|
-
raise
|
28
|
+
raise TypeError.new(msg)
|
29
29
|
else
|
30
30
|
raise
|
31
31
|
end
|
@@ -62,7 +62,7 @@ module T::Props::Serializable
|
|
62
62
|
:generate_deserialize_source
|
63
63
|
)
|
64
64
|
if msg
|
65
|
-
raise
|
65
|
+
raise TypeError.new(msg)
|
66
66
|
else
|
67
67
|
raise
|
68
68
|
end
|
@@ -138,7 +138,7 @@ module T::Props::Serializable
|
|
138
138
|
prop: prop, class: self.class.name, id: self.class.decorator.get_id(self)
|
139
139
|
)
|
140
140
|
else
|
141
|
-
raise
|
141
|
+
raise TypeError.new("#{self.class.name}.#{prop} not set for non-optional prop")
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
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.5605
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|