Class: Agave::Utils::SeoTagsBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/agave/utils/seo_tags_builder.rb

Constant Summary collapse

META_TAGS =
[
  MetaTags::Title,
  MetaTags::Description,
  MetaTags::Image,
  MetaTags::Robots,
  MetaTags::OgLocale,
  MetaTags::OgType,
  MetaTags::OgSiteName,
  MetaTags::ArticleModifiedTime,
  MetaTags::ArticlePublisher,
  MetaTags::TwitterCard,
  MetaTags::TwitterSite
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item, site) ⇒ SeoTagsBuilder

Returns a new instance of SeoTagsBuilder.



33
34
35
36
# File 'lib/agave/utils/seo_tags_builder.rb', line 33

def initialize(item, site)
  @item = item
  @site = site
end

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



31
32
33
# File 'lib/agave/utils/seo_tags_builder.rb', line 31

def item
  @item
end

#siteObject (readonly)

Returns the value of attribute site.



31
32
33
# File 'lib/agave/utils/seo_tags_builder.rb', line 31

def site
  @site
end

Instance Method Details

#meta_tagsObject



38
39
40
41
42
# File 'lib/agave/utils/seo_tags_builder.rb', line 38

def meta_tags
  META_TAGS.map do |klass|
    klass.new(item, site).build
  end.flatten.compact
end