json_logic_ruby 0.2.1 → 0.2.3
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/json_logic/evaluator.rb +2 -2
- data/lib/json_logic/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 331a993f35775659005673c1627c25e9a6a9fba1b6ae457d56643c0dd19ea3ce
|
4
|
+
data.tar.gz: 429fa17806f595566ec659c8209c60ed1cc74d7cdecafeaa10865a385ebb6b58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fb1dbd4b674963ff19754b60814e7a4ccf37db4bdb31b6d7a664ae0c48fc4244e7b4e2d87f3145a57b3d05d1f86b93ddc5feecd904b63b1efa8df4f4bd1a2b4
|
7
|
+
data.tar.gz: 5f8560cf10d8a22a86905913a111533a5b11d73d8e473525c33e624ee9fba99ecc36c1b06496547eaeec187557ec6eb9b30e6796da66c4463ec2f06410c5e5d8
|
data/lib/json_logic/evaluator.rb
CHANGED
@@ -96,7 +96,7 @@ module JsonLogic
|
|
96
96
|
end
|
97
97
|
|
98
98
|
if rules.is_a?(Hash)
|
99
|
-
rules.
|
99
|
+
rules.each_value { |rule| fetch_var_values(rule, var_name, values) }
|
100
100
|
return values
|
101
101
|
end
|
102
102
|
|
@@ -134,7 +134,7 @@ module JsonLogic
|
|
134
134
|
rescue TypeError
|
135
135
|
data = data[key.to_i]
|
136
136
|
end
|
137
|
-
data
|
137
|
+
data.nil? ? default_value : data
|
138
138
|
end
|
139
139
|
|
140
140
|
# This method retrieves the variable name from a hash of rules based on the given operator.
|
data/lib/json_logic/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_logic_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Volodymyr Stashchenko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-03-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -27,7 +27,9 @@ dependencies:
|
|
27
27
|
version: '7.0'
|
28
28
|
description: Build complex rules, serialize them as JSON, and execute them in ruby.
|
29
29
|
See https://jsonlogic.com
|
30
|
-
email:
|
30
|
+
email:
|
31
|
+
- stashchenko@ukr.net
|
32
|
+
- savka.ai2015@gmail.com
|
31
33
|
executables: []
|
32
34
|
extensions: []
|
33
35
|
extra_rdoc_files: []
|
@@ -39,7 +41,7 @@ files:
|
|
39
41
|
- lib/json_logic/rule.rb
|
40
42
|
- lib/json_logic/validator.rb
|
41
43
|
- lib/json_logic/version.rb
|
42
|
-
homepage: https://github.com/useful-libs/
|
44
|
+
homepage: https://github.com/useful-libs/json_logic_ruby
|
43
45
|
licenses:
|
44
46
|
- MIT
|
45
47
|
metadata:
|