json_logic 0.4.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 375c4179f20abd547af7992c9946a6011e536581
4
- data.tar.gz: 85fdbfe24a920389383600f116d2866224c4b480
3
+ metadata.gz: 677b105ac790d969a647b1244272dec1d489ce8f
4
+ data.tar.gz: 2c2541c2edc2616d65e408084cb069350551dfa4
5
5
  SHA512:
6
- metadata.gz: d785101c15e9d1da6501a0ebaba7fb3f3bd442f6aaaf1a3ec7a74039ec849adc9fb52e77be55406b5a8a0da0770d533306c1d2c730577b4365f0e24b128cad44
7
- data.tar.gz: 51356563bb58fd56fb0c8595b93476dff9b957e9b297096bddb98b867f0c0995662a400f4442983a18700391cbf25313ebd7278519569654db4e633978806882
6
+ metadata.gz: 061f7d199adc1ddd4482aa446e10ea3cfadaeca343e4f4ec1de6629eab3db944828065ef4d123ac5153dcf16d8860a5767ec4f30767c411c4a0055233f5d4a45
7
+ data.tar.gz: 8451f7ac97031790f913c6b223d243ec476ddf71e1205f19b1f604c6a182960aa860bbffee0117aa98e1d245e6ffd38ad0bf74ed5d69ff139d4c8f213ec7a3b0
@@ -4,7 +4,12 @@ require 'json_logic/truthy'
4
4
  require 'json_logic/operation'
5
5
  module JSONLogic
6
6
  def self.apply(logic, data)
7
+ if logic.is_a?(Array)
8
+ return logic.map { |val| apply(val, data) }
9
+ end
10
+
7
11
  return logic unless logic.is_a?(Hash) # pass-thru
12
+
8
13
  data = data.stringify_keys if data.is_a?(Hash) # Stringify keys to keep out problems with symbol/string mismatch
9
14
  operator, values = logic.first # unwrap single-key hash
10
15
  values = [values] unless values.is_a?(Array) # syntactic sugar
@@ -1,3 +1,3 @@
1
1
  module JSONLogic
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_logic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenneth Geerts
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-22 00:00:00.000000000 Z
12
+ date: 2018-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler