Class: Dato::Local::FieldType::GlobalSeo
- Inherits:
-
Object
- Object
- Dato::Local::FieldType::GlobalSeo
- Defined in:
- lib/dato/local/field_type/global_seo.rb
Instance Attribute Summary collapse
-
#facebook_page_url ⇒ Object
readonly
Returns the value of attribute facebook_page_url.
-
#site_name ⇒ Object
readonly
Returns the value of attribute site_name.
-
#title_suffix ⇒ Object
readonly
Returns the value of attribute title_suffix.
-
#twitter_account ⇒ Object
readonly
Returns the value of attribute twitter_account.
Class Method Summary collapse
Instance Method Summary collapse
- #fallback_seo ⇒ Object
-
#initialize(site_name, title_suffix, twitter_account, facebook_page_url, fallback_seo, repo) ⇒ GlobalSeo
constructor
A new instance of GlobalSeo.
- #to_hash(*args) ⇒ Object
Constructor Details
#initialize(site_name, title_suffix, twitter_account, facebook_page_url, fallback_seo, repo) ⇒ GlobalSeo
Returns a new instance of GlobalSeo.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# 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 |
Instance Attribute Details
#facebook_page_url ⇒ Object (readonly)
Returns the value of attribute facebook_page_url.
9 10 11 |
# File 'lib/dato/local/field_type/global_seo.rb', line 9 def facebook_page_url @facebook_page_url end |
#site_name ⇒ Object (readonly)
Returns the value of attribute site_name.
9 10 11 |
# File 'lib/dato/local/field_type/global_seo.rb', line 9 def site_name @site_name end |
#title_suffix ⇒ Object (readonly)
Returns the value of attribute title_suffix.
9 10 11 |
# File 'lib/dato/local/field_type/global_seo.rb', line 9 def title_suffix @title_suffix end |
#twitter_account ⇒ Object (readonly)
Returns the value of attribute twitter_account.
9 10 11 |
# File 'lib/dato/local/field_type/global_seo.rb', line 9 def twitter_account @twitter_account end |
Class Method Details
.parse(value, repo) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# 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 |
Instance Method Details
#fallback_seo ⇒ Object
38 39 40 |
# 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) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# 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 |