cortex-snippets-client 1.1.6 → 1.1.8

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
  SHA1:
3
- metadata.gz: a54d6486e266cde9ca1ad6dba02554f7833cd1ae
4
- data.tar.gz: 4efa6dff681ddc00e0a69bb6c82d670c522b7219
3
+ metadata.gz: 7ae00a884766dfbca402f2a8bff3942a428b444b
4
+ data.tar.gz: a89ffe893ebf87e8b0783944c409385993be675e
5
5
  SHA512:
6
- metadata.gz: 39be5f58f2add45cfc17c95fee5c8f144fd15af4e05e28ff8ea0899dc0409203e047428b2031b90d22d2d49e74717b438280527d80cfcbcef0d8ecb8b8d1931b
7
- data.tar.gz: 17e18f82e1c4404e850983d3dd533dc82edd33de683f4427ebe5914ee16f93be59e20a349f6336e2e462440b04e71532b10c2e7fbbbe39b1cfc16697907842b0
6
+ metadata.gz: d824cd442c589124cf3c59e265b8863569183bbe83eec7e524749c62ca33ecfcecf9d7081c6fc62a1778ed3ee6bd4cd22093f9510ad28885c40524a31a0a9ea9
7
+ data.tar.gz: c5a27401f0bf9ecdd12253111fa2eac2104b21d4d80432e912a4d4985f8d64b8bc85d8fb1aa83c2fb70691c5ac42043c86644035ee05e00ef343f051b930cf34
@@ -1,5 +1,5 @@
1
1
  module Cortex
2
2
  module Snippets
3
- VERSION = '1.1.6'
3
+ VERSION = '1.1.8'
4
4
  end
5
5
  end
@@ -1,20 +1,25 @@
1
1
  module Cortex
2
2
  module Snippets
3
3
  class Webpage
4
+ attr_reader :response, :url, :contents, :status
5
+
4
6
  def initialize(cortex_client, url)
5
- @webpage = cortex_client.webpages.get_feed(url).contents
7
+ @url = url
8
+ @response = cortex_client.webpages.get_feed(url)
9
+ @status = @response.status
10
+ @contents = @response.contents
6
11
  end
7
12
 
8
13
  def seo_title
9
- @webpage[:seo_title]
14
+ @contents[:seo_title]
10
15
  end
11
16
 
12
17
  def seo_description
13
- @webpage[:seo_description]
18
+ @contents[:seo_description]
14
19
  end
15
20
 
16
21
  def seo_keywords
17
- @webpage[:seo_keyword_list]
22
+ @contents[:seo_keyword_list]
18
23
  end
19
24
 
20
25
  def seo_robots
@@ -22,45 +27,45 @@ module Cortex
22
27
  index_options = [:noindex, :nofollow, :noodp, :nosnippet, :noarchive, :noimageindex]
23
28
 
24
29
  index_options.each do |index_option|
25
- robot_information << index_option if @webpage[index_option]
30
+ robot_information << index_option if @contents[index_option]
26
31
  end
27
32
 
28
33
  robot_information
29
34
  end
30
35
 
31
36
  def noindex
32
- @webpage[:noindex]
37
+ @contents[:noindex]
33
38
  end
34
39
 
35
40
  def nofollow
36
- @webpage[:nofollow]
41
+ @contents[:nofollow]
37
42
  end
38
43
 
39
44
  def noodp
40
- @webpage[:noodp]
45
+ @contents[:noodp]
41
46
  end
42
47
 
43
48
  def nosnippet
44
- @webpage[:nosnippet]
49
+ @contents[:nosnippet]
45
50
  end
46
51
 
47
52
  def noarchive
48
- @webpage[:noarchive]
53
+ @contents[:noarchive]
49
54
  end
50
55
 
51
56
  def noimageindex
52
- @webpage[:noimageindex]
57
+ @contents[:noimageindex]
53
58
  end
54
59
 
55
60
  def dynamic_yield
56
61
  {
57
- sku: @webpage[:dynamic_yield_sku],
58
- category: @webpage[:dynamic_yield_category]
62
+ sku: @contents[:dynamic_yield_sku],
63
+ category: @contents[:dynamic_yield_category]
59
64
  }
60
65
  end
61
66
 
62
67
  def tables_widget_data
63
- JSON.parse(@webpage[:tables_widget_json] || 'null', quirks_mode: true)
68
+ JSON.parse(@contents[:tables_widget_json] || 'null', quirks_mode: true)
64
69
  end
65
70
 
66
71
  def tables_widget_data_for(section_name)
@@ -68,7 +73,7 @@ module Cortex
68
73
  end
69
74
 
70
75
  def carousels_widget_data
71
- JSON.parse(@webpage[:carousels_widget_json] || 'null', quirks_mode: true)
76
+ JSON.parse(@contents[:carousels_widget_json] || 'null', quirks_mode: true)
72
77
  end
73
78
 
74
79
  def carousels_widget_data_for(section_name)
@@ -76,7 +81,7 @@ module Cortex
76
81
  end
77
82
 
78
83
  def galleries_widget_data
79
- JSON.parse(@webpage[:galleries_widget_json] || 'null', quirks_mode: true)
84
+ JSON.parse(@contents[:galleries_widget_json] || 'null', quirks_mode: true)
80
85
  end
81
86
 
82
87
  def galleries_widget_data_for(section_name)
@@ -84,7 +89,7 @@ module Cortex
84
89
  end
85
90
 
86
91
  def accordion_group_widget_data
87
- JSON.parse(@webpage[:accordion_group_widget_json] || 'null', quirks_mode: true)
92
+ JSON.parse(@contents[:accordion_group_widget_json] || 'null', quirks_mode: true)
88
93
  end
89
94
 
90
95
  def accordion_group_widget_data_for(section_name)
@@ -92,11 +97,11 @@ module Cortex
92
97
  end
93
98
 
94
99
  def charts_widget_data
95
- JSON.parse(@webpage[:charts_widget_json] || 'null', quirks_mode: true)
100
+ JSON.parse(@contents[:charts_widget_json] || 'null', quirks_mode: true)
96
101
  end
97
102
 
98
103
  def buy_box_widget_data
99
- JSON.parse(@webpage[:buy_box_widget_json] || 'null', quirks_mode: true)
104
+ JSON.parse(@contents[:buy_box_widget_json] || 'null', quirks_mode: true)
100
105
  end
101
106
 
102
107
  def charts_widget_data_for(section_name)
@@ -104,7 +109,7 @@ module Cortex
104
109
  end
105
110
 
106
111
  def snippets
107
- @webpage[:snippets]
112
+ @contents[:snippets]
108
113
  end
109
114
  end
110
115
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cortex-snippets-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - CareerBuilder Employer Site & Content Products
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-16 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cortex-client