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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 892319b2cab325e75d0e1350c2f6e58e01ecf4ca5cee5ba1228193a51f99e3ca
4
- data.tar.gz: 9eba5d4e93b559d8ea59300dcd41f0188dc03ac72c5152e78c3a3d9e4b730781
3
+ metadata.gz: dcd400b724a3b0afebdb95df4ce66929b047a2b13d20be1c377caf1f207288a5
4
+ data.tar.gz: ef17fc111fcc824c7b8a54a156b65a91982c6e06883823cfc57521221d541498
5
5
  SHA512:
6
- metadata.gz: 05e7e6c2f863b4f1e62d9558b5c670cc8e7eac0398bb150c1f5a71865e25492417d6c9efd8699bfce27ef576fb58a81aa20386cb3af37faee6d599a46466667b
7
- data.tar.gz: 66ccf6ba5a410b92c8e4ba1268b27d3c5c4797c61cda7185fc832cf26c6d4bc13f97d157873f6030a5889df5712df94ef365387053cd054131b568e239c90825
6
+ metadata.gz: d2a2c513cc9c18b6500bb3b04b48b67d7559966eab4b63d0254bdeb3c8a732ac667b490df4dcc764277417fb242f8c61fa8cf9b8285c22bf2dd556c995eb0d8f
7
+ data.tar.gz: ebb5c2011ef2a188a393aa452250b8034a6c9fc2c7223cbdc2cba32d722fa1504871cd2fd8a75abb5767a4c4832a6e246579578c1a3e12216f501f641dde860b
@@ -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
@@ -1,3 +1,3 @@
1
1
  class JsonDataExtractor
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.7'
3
3
  end
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.5
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-03-28 00:00:00.000000000 Z
11
+ date: 2023-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler