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.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/dato/local/field_type/global_seo.rb', line 25 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.
12 13 14 |
# File 'lib/dato/local/field_type/global_seo.rb', line 12 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.
10 11 12 |
# File 'lib/dato/local/field_type/global_seo.rb', line 10 def title_suffix @title_suffix end |
#twitter_account ⇒ Object (readonly)
Returns the value of attribute twitter_account.
11 12 13 |
# File 'lib/dato/local/field_type/global_seo.rb', line 11 def twitter_account @twitter_account end |
Class Method Details
.parse(value, repo) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dato/local/field_type/global_seo.rb', line 14 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
41 42 43 |
# File 'lib/dato/local/field_type/global_seo.rb', line 41 def fallback_seo @fallback_seo && Seo.parse(@fallback_seo, @repo) end |
#to_hash(*args) ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/dato/local/field_type/global_seo.rb', line 45 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 |