Class: Seorel::Controller::Params

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Configurable
Defined in:
lib/seorel/controller/params.rb

Instance Method Summary collapse

Constructor Details

#initialize(controller = nil) ⇒ Params

Returns a new instance of Params.



15
16
17
# File 'lib/seorel/controller/params.rb', line 15

def initialize(controller = nil)
  @controller = controller
end

Instance Method Details

#descriptionObject



34
35
36
37
38
39
40
41
# File 'lib/seorel/controller/params.rb', line 34

def description
  [
    lookup_prepend_description,
    base_description,
    page_text,
    lookup_append_description
  ].compact.join.html_safe
end

#imageObject



47
48
49
# File 'lib/seorel/controller/params.rb', line 47

def image
  config.image || default_options.default_image
end

#keywordsObject



43
44
45
# File 'lib/seorel/controller/params.rb', line 43

def keywords
  default_options.default_keywords
end

#open_graph_extrasObject



51
52
53
# File 'lib/seorel/controller/params.rb', line 51

def open_graph_extras
  default_options.default_og_metas
end

#page_textObject



19
20
21
22
23
# File 'lib/seorel/controller/params.rb', line 19

def page_text
  return unless available_pagination?

  default_options.pagination_format.gsub('%page%', pagination_page)
end

#titleObject



25
26
27
28
29
30
31
32
# File 'lib/seorel/controller/params.rb', line 25

def title
  [
    lookup_prepend_title,
    base_title,
    page_text,
    lookup_append_title
  ].compact.join.html_safe
end

#twitter_extrasObject



55
56
57
# File 'lib/seorel/controller/params.rb', line 55

def twitter_extras
  default_options.default_twitter_metas
end