apimatic_core 0.3.5 → 0.3.6
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/apimatic-core/utilities/api_helper.rb +12 -4
- 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: 98a7a24dd99dffe816667bdbd683775d7b4961a2159cdcca5f6d01202aaad8cb
|
4
|
+
data.tar.gz: e869b19703d585e264d2786da045a2689f14cd5a905b1124bbd4f37df097ec63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e49802888b0b9e38e94f8e287ba5b4fdfd049145643ec2f39076f5b2d4a5d8ebb6d54599aa89f016597ca9ad2f7d6d4f2a60f4a10654d654ee0a7429a809866f
|
7
|
+
data.tar.gz: 95cff96de07545fe02287eff869b34b43e424ca094ccde6ecf9ef892c0f0b019c1b5b9fd9959962ceaef10a9b541329288a3db881421b35d6f8057c6d4a383dc
|
@@ -261,13 +261,21 @@ module CoreLibrary
|
|
261
261
|
# Checks if a value or all values in a nested structure satisfy a given type condition.
|
262
262
|
# @param [Object] value The value or nested structure to be checked.
|
263
263
|
# @param [Proc] type_callable A callable object that defines the type condition.
|
264
|
+
# @param [Boolean] is_model_hash A flag to identify the provided value is a model value hash.
|
265
|
+
# @param [Boolean] is_inner_model_hash A flag to identify the provided value is a hash of model value hash.
|
264
266
|
# @return [Boolean] Returns true if the value or all values in the
|
265
267
|
# structure satisfy the type condition, false otherwise.
|
266
|
-
def self.valid_type?(value, type_callable)
|
268
|
+
def self.valid_type?(value, type_callable, is_model_hash: false, is_inner_model_hash: false)
|
267
269
|
if value.is_a?(Array)
|
268
|
-
value.all?
|
269
|
-
|
270
|
-
|
270
|
+
value.all? do |item|
|
271
|
+
valid_type?(item, type_callable,
|
272
|
+
is_model_hash: is_model_hash,
|
273
|
+
is_inner_model_hash: is_inner_model_hash)
|
274
|
+
end
|
275
|
+
elsif value.is_a?(Hash) && (!is_model_hash || is_inner_model_hash)
|
276
|
+
value.values.all? do |item|
|
277
|
+
valid_type?(item, type_callable, is_model_hash: is_model_hash)
|
278
|
+
end
|
271
279
|
else
|
272
280
|
!value.nil? && type_callable.call(value)
|
273
281
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apimatic_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- APIMatic Ltd.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apimatic_core_interfaces
|