contentful-scheduler-custom 1.6.7.5306 → 1.6.7.5307

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: 700551e41c83f6056ffda53598bf8841d577f5dc48e25c0e9bddc2c2b9418aa6
4
- data.tar.gz: 92fc0df6e2d02eaadc9e6e3b48acff59a3309d2c030d739401f878073d8e363e
3
+ metadata.gz: a566cc65725611103658c94e15ff9739a217aa441f2375f333177526c43865d2
4
+ data.tar.gz: be86aa3f4cc2107edfce7143c24995b92e408139c2fa11558e41b6f53f93fe16
5
5
  SHA512:
6
- metadata.gz: fff0cc3a64d86c88f4014537316523837e969b7572c75ba69ca0437c811f002920853bec23d5ecbdbd22787f4a03ee5a91c69ce5d72379af14e9fbb30be1ed0e
7
- data.tar.gz: 783ecd869f540f40ae6936f03a544dff803d35a51ea43f6e36cf3825eaf6efed54ecdeb73ea48ff23b4fa516f5bbf5b3ff80bf0f263b9944c3c58aa3582dbc9e
6
+ metadata.gz: fc51500e74e73ce938248626e36e892ac5b6db9ea78c06e5b430d2712342f7ef0cf92bd9de5c468947591f7e2f9583945908dad19af62bcb4f7e086f84f4b8de
7
+ data.tar.gz: 12e36dbd4135b4dfa83f069bb24dc53084257a8c22afe30225bd4a1eabd1afe23e78113a8e93849c60513e01df67a8fb1ab9ee1d4a654fafb7dcc7fc484a0c2d
@@ -36,6 +36,30 @@ module Contentful
36
36
  end
37
37
 
38
38
 
39
+ def extract_element_ids(input_array)
40
+ ids = []
41
+ input_array.each {|item| (ids << (get_each_field item)).flatten!}
42
+ ids.uniq
43
+ end
44
+
45
+ def get_each_field(item)
46
+ ids = []
47
+ keys = item["fields"].keys
48
+ keys.each {|key| (ids << (get_each_element key, item["fields"])).flatten!}
49
+ return ids
50
+ end
51
+
52
+ def get_each_element(key, item)
53
+ ids = []
54
+ if item[key].kind_of?(Array)
55
+ item[key].each {|i| (!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil}
56
+ elsif item[key].kind_of?(Hash)
57
+ (!( item[key]["sys"]["linkType"].nil? ) && item[key]["sys"]["linkType"] == "Entry") ? ids.push(item[key]["sys"]["id"]) : nil
58
+ end
59
+ return ids
60
+ end
61
+
62
+
39
63
 
40
64
 
41
65
  =begin
@@ -65,28 +89,6 @@ module Contentful
65
89
  end
66
90
 
67
91
 
68
- def extract_element_ids(input_array)
69
- ids = []
70
- input_array.each {|item| (ids << (get_each_field item)).flatten!}
71
- ids.uniq
72
- end
73
-
74
- def get_each_field(item)
75
- ids = []
76
- keys = item["fields"].keys
77
- keys.each {|key| (ids << (get_each_element key, item["fields"])).flatten!}
78
- return ids
79
- end
80
-
81
- def get_each_element(key, item)
82
- ids = []
83
- if item[key].kind_of?(Array)
84
- item[key].each {|i| (!(i["sys"]["linkType"].nil?) && i["sys"]["linkType"] == "Entry") ? ids.push(i["sys"]["id"]) : nil}
85
- elsif item[key].kind_of?(Hash)
86
- (!( item[key]["sys"]["linkType"].nil? ) && item[key]["sys"]["linkType"] == "Entry") ? ids.push(item[key]["sys"]["id"]) : nil
87
- end
88
- return ids
89
- end
90
92
 
91
93
  end
92
94
  end
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Scheduler
3
- VERSION = "1.6.7.5306"
3
+ VERSION = "1.6.7.5307"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-scheduler-custom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.7.5306
4
+ version: 1.6.7.5307
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (David Litvak Bruno0