module Cortex::Snippets::Client::Helper

Public Instance Methods

noarchive() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 44
def noarchive
  webpage[:noarchive]
end
nofollow() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 32
def nofollow
  webpage[:nofollow]
end
noimageindex() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 48
def noimageindex
  webpage[:noimageindex]
end
noindex() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 28
def noindex
  webpage[:noindex]
end
noodp() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 36
def noodp
  webpage[:noodp]
end
nosnippet() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 40
def nosnippet
  webpage[:nosnippet]
end
seo_description() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 20
def seo_description
  webpage[:seo_description]
end
seo_keywords() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 24
def seo_keywords
  webpage[:seo_keywords]
end
seo_title() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 16
def seo_title
  webpage[:seo_title]
end
snippet(options = {}, &block) click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 5
def snippet(options = {}, &block)
  snippets = webpage[:snippets] || []
  snippet = snippets.find { |snippet| snippet[:document][:name] == options[:id] }

  if snippet.nil? || snippet[:document][:body].nil? || snippet[:document][:body].empty?
    content_tag(:snippet, capture(&block), options)
  else
    content_tag(:snippet, snippet[:document][:body].html_safe, options)
  end
end

Private Instance Methods

webpage() click to toggle source
# File lib/cortex/snippets/client/helper.rb, line 54
def webpage
  Cortex::Snippets::Client::current_webpage(request)
end