class Dato::Local::FieldType::GlobalSeo

Attributes

facebook_page_url[R]
site_name[R]
title_suffix[R]
twitter_account[R]

Public Class Methods

new( site_name, title_suffix, twitter_account, facebook_page_url, fallback_seo, repo ) click to toggle source
# File lib/dato/local/field_type/global_seo.rb, line 22
def initialize(
  site_name,
  title_suffix,
  twitter_account,
  facebook_page_url,
  fallback_seo,
  repo
)
  @site_name = site_name
  @title_suffix = title_suffix
  @twitter_account = twitter_account
  @facebook_page_url = facebook_page_url
  @fallback_seo = fallback_seo
  @repo = repo
end
parse(value, repo) click to toggle source
# File lib/dato/local/field_type/global_seo.rb, line 11
def self.parse(value, repo)
  value && new(
    value[:site_name],
    value[:title_suffix],
    value[:twitter_account],
    value[:facebook_page_url],
    value[:fallback_seo],
    repo,
  )
end

Public Instance Methods

fallback_seo() click to toggle source
# File lib/dato/local/field_type/global_seo.rb, line 38
def fallback_seo
  @fallback_seo && Seo.parse(@fallback_seo, @repo)
end
to_hash(*args) click to toggle source
# File lib/dato/local/field_type/global_seo.rb, line 42
def to_hash(*args)
  {
    site_name: site_name,
    title_suffix: title_suffix,
    twitter_account: twitter_account,
    facebook_page_url: facebook_page_url,
    fallback_seo: fallback_seo && fallback_seo.to_hash(*args),
  }
end