Class: Cortex::Snippets::Client::Webpage
- Inherits:
-
Object
- Object
- Cortex::Snippets::Client::Webpage
- Defined in:
- lib/cortex/snippets/client/webpage.rb
Instance Method Summary collapse
- #dynamic_yield ⇒ Object
-
#initialize(cortex_client, url) ⇒ Webpage
constructor
A new instance of Webpage.
- #noarchive ⇒ Object
- #nofollow ⇒ Object
- #noimageindex ⇒ Object
- #noindex ⇒ Object
- #noodp ⇒ Object
- #nosnippet ⇒ Object
- #seo_description ⇒ Object
- #seo_keywords ⇒ Object
- #seo_robots ⇒ Object
- #seo_title ⇒ Object
- #snippets ⇒ Object
Constructor Details
#initialize(cortex_client, url) ⇒ Webpage
Returns a new instance of Webpage.
5 6 7 |
# File 'lib/cortex/snippets/client/webpage.rb', line 5 def initialize(cortex_client, url) @webpage = cortex_client.webpages.get_feed(url).contents end |
Instance Method Details
#dynamic_yield ⇒ Object
56 57 58 59 60 61 |
# File 'lib/cortex/snippets/client/webpage.rb', line 56 def dynamic_yield { sku: @webpage[:dynamic_yield_sku], category: @webpage[:dynamic_yield_category] } end |
#noarchive ⇒ Object
48 49 50 |
# File 'lib/cortex/snippets/client/webpage.rb', line 48 def noarchive @webpage[:noarchive] end |
#nofollow ⇒ Object
36 37 38 |
# File 'lib/cortex/snippets/client/webpage.rb', line 36 def nofollow @webpage[:nofollow] end |
#noimageindex ⇒ Object
52 53 54 |
# File 'lib/cortex/snippets/client/webpage.rb', line 52 def noimageindex @webpage[:noimageindex] end |
#noindex ⇒ Object
32 33 34 |
# File 'lib/cortex/snippets/client/webpage.rb', line 32 def noindex @webpage[:noindex] end |
#noodp ⇒ Object
40 41 42 |
# File 'lib/cortex/snippets/client/webpage.rb', line 40 def noodp @webpage[:noodp] end |
#nosnippet ⇒ Object
44 45 46 |
# File 'lib/cortex/snippets/client/webpage.rb', line 44 def nosnippet @webpage[:nosnippet] end |
#seo_description ⇒ Object
13 14 15 |
# File 'lib/cortex/snippets/client/webpage.rb', line 13 def seo_description @webpage[:seo_description] end |
#seo_keywords ⇒ Object
17 18 19 |
# File 'lib/cortex/snippets/client/webpage.rb', line 17 def seo_keywords @webpage[:seo_keyword_list] end |
#seo_robots ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/cortex/snippets/client/webpage.rb', line 21 def seo_robots robot_information = [] = [:noindex, :nofollow, :noodp, :nosnippet, :noarchive, :noimageindex] .each do |index_option| robot_information << index_option if @webpage[index_option] end robot_information end |
#seo_title ⇒ Object
9 10 11 |
# File 'lib/cortex/snippets/client/webpage.rb', line 9 def seo_title @webpage[:seo_title] end |
#snippets ⇒ Object
63 64 65 |
# File 'lib/cortex/snippets/client/webpage.rb', line 63 def snippets @webpage[:snippets] end |