Class: SeoSnippet
- Inherits:
-
Object
- Object
- SeoSnippet
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Model
- Defined in:
- app/services/seo_snippet.rb
Constant Summary collapse
- DEFAULT_PARAMS =
{ "corporate_contacts_attributes" => {"0" => {}}, "label" => "seo_snippet", "context" => "http://schema.org", "type" => "Organization" }
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#corporate_contacts ⇒ Object
Returns the value of attribute corporate_contacts.
-
#corporate_contacts_attributes ⇒ Object
Returns the value of attribute corporate_contacts_attributes.
-
#facebook_url ⇒ Object
Returns the value of attribute facebook_url.
-
#google_plus_url ⇒ Object
Returns the value of attribute google_plus_url.
-
#instagram_url ⇒ Object
Returns the value of attribute instagram_url.
-
#label ⇒ Object
Returns the value of attribute label.
-
#linkedin_url ⇒ Object
Returns the value of attribute linkedin_url.
-
#logo ⇒ Object
Returns the value of attribute logo.
-
#pinterest_url ⇒ Object
Returns the value of attribute pinterest_url.
-
#twitter_url ⇒ Object
Returns the value of attribute twitter_url.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#youtube_url ⇒ Object
Returns the value of attribute youtube_url.
Instance Method Summary collapse
- #corporate_contacts_validator ⇒ Object
-
#initialize(params = {}) ⇒ SeoSnippet
constructor
A new instance of SeoSnippet.
Constructor Details
#initialize(params = {}) ⇒ SeoSnippet
Returns a new instance of SeoSnippet.
20 21 22 23 |
# File 'app/services/seo_snippet.rb', line 20 def initialize(params={}) params = DEFAULT_PARAMS.merge(params) super # calls (amongst other methods): corporate_contacts_attributes=(attrs) end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def context @context end |
#corporate_contacts ⇒ Object
Returns the value of attribute corporate_contacts.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def corporate_contacts @corporate_contacts end |
#corporate_contacts_attributes ⇒ Object
Returns the value of attribute corporate_contacts_attributes.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def corporate_contacts_attributes @corporate_contacts_attributes end |
#facebook_url ⇒ Object
Returns the value of attribute facebook_url.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def facebook_url @facebook_url end |
#google_plus_url ⇒ Object
Returns the value of attribute google_plus_url.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def google_plus_url @google_plus_url end |
#instagram_url ⇒ Object
Returns the value of attribute instagram_url.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def instagram_url @instagram_url end |
#label ⇒ Object
Returns the value of attribute label.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def label @label end |
#linkedin_url ⇒ Object
Returns the value of attribute linkedin_url.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def linkedin_url @linkedin_url end |
#logo ⇒ Object
Returns the value of attribute logo.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def logo @logo end |
#pinterest_url ⇒ Object
Returns the value of attribute pinterest_url.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def pinterest_url @pinterest_url end |
#twitter_url ⇒ Object
Returns the value of attribute twitter_url.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def twitter_url @twitter_url end |
#type ⇒ Object
Returns the value of attribute type.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def url @url end |
#youtube_url ⇒ Object
Returns the value of attribute youtube_url.
12 13 14 |
# File 'app/services/seo_snippet.rb', line 12 def youtube_url @youtube_url end |
Instance Method Details
#corporate_contacts_validator ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/services/seo_snippet.rb', line 31 def corporate_contacts_validator error_hash = {} @corporate_contacts.each do |contact| unless contact.valid? contact.errors..each do |error_name, | error_hash[error_name] = .join end end end return error_hash end |