json_data_extractor 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/json_data_extractor.rb +2 -2
- data/lib/src/version.rb +1 -1
- 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: dcd400b724a3b0afebdb95df4ce66929b047a2b13d20be1c377caf1f207288a5
|
4
|
+
data.tar.gz: ef17fc111fcc824c7b8a54a156b65a91982c6e06883823cfc57521221d541498
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2a2c513cc9c18b6500bb3b04b48b67d7559966eab4b63d0254bdeb3c8a732ac667b490df4dcc764277417fb242f8c61fa8cf9b8285c22bf2dd556c995eb0d8f
|
7
|
+
data.tar.gz: ebb5c2011ef2a188a393aa452250b8034a6c9fc2c7223cbdc2cba32d722fa1504871cd2fd8a75abb5767a4c4832a6e246579578c1a3e12216f501f641dde860b
|
data/lib/json_data_extractor.rb
CHANGED
@@ -5,7 +5,7 @@ class JsonDataExtractor
|
|
5
5
|
attr_reader :data, :modifiers
|
6
6
|
|
7
7
|
def initialize(json_data, modifiers = {})
|
8
|
-
@data = json_data
|
8
|
+
@data = json_data.is_a?(Hash) ? json_data.to_json : json_data # hopefully it's a string; maybe we'll add some validation here
|
9
9
|
@modifiers = modifiers.transform_keys(&:to_sym) # todo address this later
|
10
10
|
end
|
11
11
|
|
@@ -43,7 +43,7 @@ class JsonDataExtractor
|
|
43
43
|
elsif nested
|
44
44
|
results[key] = []
|
45
45
|
Array(extracted_data).each do |item|
|
46
|
-
results[key] << self.class.new(item).extract(nested)
|
46
|
+
results[key] << self.class.new(item, @modifiers).extract(nested)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
data/lib/src/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_data_extractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Buslaev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|