cortex-snippets-client 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 121d29bad86ddf332d53b68a548d2cbdc4a41961
4
- data.tar.gz: af22ef08cc4e2a40c91b556a70cd8a09e435450f
3
+ metadata.gz: 69d33e7f18162eec2d559b14d5b4bccc3e11e89c
4
+ data.tar.gz: 951cd8527f1983b4c14282dd1a13f200ee1e3856
5
5
  SHA512:
6
- metadata.gz: 4f175994fbfc381db38a7e7d62bbb215620809a55c98ef97cdaf91dd4f97f52d4bf2b09e83323131ce0c803d11fe331c97e241a1cab368006eb530ca459bf415
7
- data.tar.gz: 00ee942abbea532d4b6a899a8968e5bf6e976f2aadf4c4447e404b0927f23e9dd8b035715d57e15ab0ec3459a60ac662273bb9dfdba455f881eca8692ccdfbdb
6
+ metadata.gz: 73ab2963e44404f588c7c790b1fc5b2c90a063a1533958f6de93c575e1c2320ba0e1391c6579f4a8c9eca13978ff28e6b9fe27fe196b8968800ee8b7c01672ef
7
+ data.tar.gz: 2db3bf33566db5ca9219f8af32e35c82421c76a531d807bafb0fe203e6f745feb92e661bbebee7d9fb351527dbee70ac7464d38f21c0b6148c895d999db43582
@@ -1,5 +1,5 @@
1
1
  module Cortex
2
2
  module Snippets
3
- VERSION = '1.2.0'
3
+ VERSION = '1.2.1'
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,38 +27,38 @@ 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 tables_widget_data
56
- JSON.parse(@webpage[:tables_widget_json] || 'null', quirks_mode: true)
61
+ JSON.parse(@contents[:tables_widget_json] || 'null', quirks_mode: true)
57
62
  end
58
63
 
59
64
  def tables_widget_data_for(section_name)
@@ -61,7 +66,7 @@ module Cortex
61
66
  end
62
67
 
63
68
  def carousels_widget_data
64
- JSON.parse(@webpage[:carousels_widget_json] || 'null', quirks_mode: true)
69
+ JSON.parse(@contents[:carousels_widget_json] || 'null', quirks_mode: true)
65
70
  end
66
71
 
67
72
  def carousels_widget_data_for(section_name)
@@ -69,7 +74,7 @@ module Cortex
69
74
  end
70
75
 
71
76
  def galleries_widget_data
72
- JSON.parse(@webpage[:galleries_widget_json] || 'null', quirks_mode: true)
77
+ JSON.parse(@contents[:galleries_widget_json] || 'null', quirks_mode: true)
73
78
  end
74
79
 
75
80
  def galleries_widget_data_for(section_name)
@@ -77,7 +82,7 @@ module Cortex
77
82
  end
78
83
 
79
84
  def accordion_group_widget_data
80
- JSON.parse(@webpage[:accordion_group_widget_json] || 'null', quirks_mode: true)
85
+ JSON.parse(@contents[:accordion_group_widget_json] || 'null', quirks_mode: true)
81
86
  end
82
87
 
83
88
  def accordion_group_widget_data_for(section_name)
@@ -85,11 +90,11 @@ module Cortex
85
90
  end
86
91
 
87
92
  def charts_widget_data
88
- JSON.parse(@webpage[:charts_widget_json] || 'null', quirks_mode: true)
93
+ JSON.parse(@contents[:charts_widget_json] || 'null', quirks_mode: true)
89
94
  end
90
95
 
91
96
  def buy_box_widget_data
92
- JSON.parse(@webpage[:buy_box_widget_json] || 'null', quirks_mode: true)
97
+ JSON.parse(@contents[:buy_box_widget_json] || 'null', quirks_mode: true)
93
98
  end
94
99
 
95
100
  def charts_widget_data_for(section_name)
@@ -97,11 +102,11 @@ module Cortex
97
102
  end
98
103
 
99
104
  def product_data
100
- JSON.parse(@webpage[:product_data_json] || 'null', quirks_mode: true)
105
+ JSON.parse(@contents[:product_data_json] || 'null', quirks_mode: true)
101
106
  end
102
107
 
103
108
  def snippets
104
- @webpage[:snippets]
109
+ @contents[:snippets]
105
110
  end
106
111
  end
107
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cortex-snippets-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CareerBuilder Employer Site & Content Products