Class: Cortex::Snippets::Client::Webpage

Inherits:
Object
  • Object
show all
Defined in:
lib/cortex/snippets/client/webpage.rb

Instance Method Summary collapse

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_yieldObject



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

#noarchiveObject



48
49
50
# File 'lib/cortex/snippets/client/webpage.rb', line 48

def noarchive
  @webpage[:noarchive]
end

#nofollowObject



36
37
38
# File 'lib/cortex/snippets/client/webpage.rb', line 36

def nofollow
  @webpage[:nofollow]
end

#noimageindexObject



52
53
54
# File 'lib/cortex/snippets/client/webpage.rb', line 52

def noimageindex
  @webpage[:noimageindex]
end

#noindexObject



32
33
34
# File 'lib/cortex/snippets/client/webpage.rb', line 32

def noindex
  @webpage[:noindex]
end

#noodpObject



40
41
42
# File 'lib/cortex/snippets/client/webpage.rb', line 40

def noodp
  @webpage[:noodp]
end

#nosnippetObject



44
45
46
# File 'lib/cortex/snippets/client/webpage.rb', line 44

def nosnippet
  @webpage[:nosnippet]
end

#seo_descriptionObject



13
14
15
# File 'lib/cortex/snippets/client/webpage.rb', line 13

def seo_description
  @webpage[:seo_description]
end

#seo_keywordsObject



17
18
19
# File 'lib/cortex/snippets/client/webpage.rb', line 17

def seo_keywords
  @webpage[:seo_keyword_list]
end

#seo_robotsObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/cortex/snippets/client/webpage.rb', line 21

def seo_robots
  robot_information = []
  index_options = [:noindex, :nofollow, :noodp, :nosnippet, :noarchive, :noimageindex]

  index_options.each do |index_option|
    robot_information << index_option if @webpage[index_option]
  end

  robot_information
end

#seo_titleObject



9
10
11
# File 'lib/cortex/snippets/client/webpage.rb', line 9

def seo_title
  @webpage[:seo_title]
end

#snippetsObject



63
64
65
# File 'lib/cortex/snippets/client/webpage.rb', line 63

def snippets
  @webpage[:snippets]
end