json_normalizer 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/json_normalizer.rb +0 -13
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 470c287abe41d521cc780b371dc2734e7ca20624
4
- data.tar.gz: c5b8035d36b9930bfa24efb1bf4fc56337b45765
3
+ metadata.gz: 205a1d4f70be168c939a23f86d323f687ac735e1
4
+ data.tar.gz: f6b2e8144cbe813ec13773ee4b8be04f7d76f211
5
5
  SHA512:
6
- metadata.gz: 7008469d1f206ccf93dd91cb2b233768c27e883c88fe3a26a01d1baea925bd7243db8e6194af465421f99e8387cb77cf34845a20a3a7c88ad932760c22bf7d3b
7
- data.tar.gz: c1c7975c382349e101ad37730704e41647b11abdf71e63e9efbd595b937530c71f91345125f8de10a0bb0986638687bfe67ef852d5874030b431468c525561cd
6
+ metadata.gz: e77b53aa9ca3dc1370d059e6ba6429a3eaec2785758450732d69bed7f445367e55f7432637d72ea11d3d54707c7711d2726dc3041bba1c51e63c88cd410bb904
7
+ data.tar.gz: cd6feae9c2b923e4a9e513c83f940e15898206b74c6bac1f57d74318b7227fa65740e6c25221dc236bbd3377bce31a21bbdea11fe1882b20135311df117656a8
@@ -19,15 +19,6 @@ class JsonNormalizer
19
19
  @map.keys.each{ |k| return k if @map[k].include?(key) }
20
20
  end
21
21
 
22
- # def swap_key(json, key)
23
- # if self.key_contained?(key)
24
- # json[self.fetch_key(key).first] = json[key]
25
- # json.delete(key)
26
- # else
27
- # # if we want to move out non-normalized keys into a different 'misc' key or something
28
- # end
29
- # end
30
-
31
22
  def swap_key(json, key)
32
23
  if self.key_contained?(key)
33
24
  json[self.fetch_key(key)] = json[key]
@@ -42,7 +33,6 @@ class JsonNormalizer
42
33
  json.each do |j|
43
34
  j.keys.each do |key|
44
35
  if j[key].respond_to?(:each)
45
- puts "Key: #{key} recursing..."
46
36
  self.translate(j[key])
47
37
  self.swap_key(j, key)
48
38
  else
@@ -53,7 +43,6 @@ class JsonNormalizer
53
43
  else
54
44
  json.keys.each do |key|
55
45
  if json[key].respond_to?(:each)
56
- puts "Key: #{key} recursing..."
57
46
  self.translate(json[key])
58
47
  self.swap_key(json, key)
59
48
  else
@@ -62,8 +51,6 @@ class JsonNormalizer
62
51
  end
63
52
  end
64
53
 
65
- # json.map{ |k, v| [k.to_s, v] }.to_h
66
- # JSON.parse json.to_json
67
54
  json
68
55
  end
69
56
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_normalizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Tetzlaff