Class: Dato::Utils::SeoTagsBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/dato/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.



34
35
36
37
# File 'lib/dato/utils/seo_tags_builder.rb', line 34

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

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



32
33
34
# File 'lib/dato/utils/seo_tags_builder.rb', line 32

def item
  @item
end

#siteObject (readonly)

Returns the value of attribute site.



32
33
34
# File 'lib/dato/utils/seo_tags_builder.rb', line 32

def site
  @site
end

Instance Method Details

#meta_tagsObject



39
40
41
42
43
# File 'lib/dato/utils/seo_tags_builder.rb', line 39

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