Module: Cortex::Snippets::ViewHelpers

Defined in:
lib/cortex/snippets/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#noarchiveObject



38
39
40
# File 'lib/cortex/snippets/view_helpers.rb', line 38

def noarchive
  webpage[:noarchive]
end

#nofollowObject



26
27
28
# File 'lib/cortex/snippets/view_helpers.rb', line 26

def nofollow
  webpage[:nofollow]
end

#noimageindexObject



42
43
44
# File 'lib/cortex/snippets/view_helpers.rb', line 42

def noimageindex
  webpage[:noimageindex]
end

#noindexObject



22
23
24
# File 'lib/cortex/snippets/view_helpers.rb', line 22

def noindex
  webpage[:noindex]
end

#noodpObject



30
31
32
# File 'lib/cortex/snippets/view_helpers.rb', line 30

def noodp
  webpage[:noodp]
end

#nosnippetObject



34
35
36
# File 'lib/cortex/snippets/view_helpers.rb', line 34

def nosnippet
  webpage[:nosnippet]
end

#seo_descriptionObject



18
19
20
# File 'lib/cortex/snippets/view_helpers.rb', line 18

def seo_description
  webpage[:seo_description]
end

#seo_titleObject



14
15
16
# File 'lib/cortex/snippets/view_helpers.rb', line 14

def seo_title
  webpage[:seo_title]
end

#snippet(options = {}, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/cortex/snippets/view_helpers.rb', line 4

def snippet(options = {}, &block)
  snippet = webpage[:snippets].find { |snippet| snippet.name == options[:id] }

  if snippet.nil? || snippet.empty?
    (:snippet, capture(&block), id: options[:id])
  else
    (:snippet, snippet, id: options[:id])
  end
end