sorbet-runtime 0.6.13416 → 0.6.13419
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/utils.rb +21 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a88b8a8867fd30bd1a78c002ef85057e7edab4e42ee94351bac2e492e045e9f6
|
|
4
|
+
data.tar.gz: d710f2e9d232a1eb737631807cee5fa7421a9d0d370b8f173127adb9d12fefcb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '095a53cef396ef619fd168027343cad04c7bc61298da0bbdf58851156642e63e36f3cab616cc2c8c215ed810a04022a91f13db9f7a63b6713e4b4ecbd4033677'
|
|
7
|
+
data.tar.gz: 94fa009f872bb1d75a51b251a534f04955ea734e19c19e18f456ebe0af1a8bc5dd081bc08eddc39a9f6b237e946751a8ce75745d4b896bb0ddaebd6e5d75fa3e
|
data/lib/types/utils.rb
CHANGED
|
@@ -157,6 +157,27 @@ module T::Utils
|
|
|
157
157
|
"#{start_part}#{ellipsis}#{end_part}"
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
+
# Force all TypeAlias instances to resolve their effective_aliased_type eagerly.
|
|
161
|
+
#
|
|
162
|
+
# Call this while eagerly preloading a codebase (e.g. at service startup) to
|
|
163
|
+
# optimize for first-call/first-request latency.
|
|
164
|
+
def self.run_all_type_alias_blocks
|
|
165
|
+
require 'objspace'
|
|
166
|
+
ObjectSpace.each_object(T::Private::Types::TypeAlias, &:effective_aliased_type)
|
|
167
|
+
nil
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Force all T::Props::Serializable decorators to eagerly define their lazily
|
|
171
|
+
# specialized methods (serialization, deserialization, etc.).
|
|
172
|
+
#
|
|
173
|
+
# Call this while eagerly preloading a codebase (e.g. at service startup) to
|
|
174
|
+
# optimize for first-call/first-request latency.
|
|
175
|
+
def self.eagerly_define_all_lazy_props_methods!
|
|
176
|
+
require 'objspace'
|
|
177
|
+
ObjectSpace.each_object(T::Props::Serializable::DecoratorMethods, &:eagerly_define_lazy_methods!)
|
|
178
|
+
nil
|
|
179
|
+
end
|
|
180
|
+
|
|
160
181
|
def self.lift_enum(enum)
|
|
161
182
|
unless enum.is_a?(T::Types::Enum)
|
|
162
183
|
raise ArgumentError.new("#{enum.inspect} is not a T.deprecated_enum")
|