Class: MetaTags::Container
- Inherits:
-
Object
- Object
- MetaTags::Container
- Defined in:
- lib/meta_tags/container.rb
Constant Summary collapse
- TAGS_LIST =
%w( title description image url site_name keywords type site card )
Instance Attribute Summary collapse
-
#card_changed ⇒ Object
Returns the value of attribute card_changed.
-
#default_card ⇒ Object
Returns the value of attribute default_card.
-
#default_description ⇒ Object
Returns the value of attribute default_description.
-
#default_image ⇒ Object
Returns the value of attribute default_image.
-
#default_keywords ⇒ Object
Returns the value of attribute default_keywords.
-
#default_site ⇒ Object
Returns the value of attribute default_site.
-
#default_site_name ⇒ Object
Returns the value of attribute default_site_name.
-
#default_title ⇒ Object
Returns the value of attribute default_title.
-
#default_type ⇒ Object
Returns the value of attribute default_type.
-
#default_url ⇒ Object
Returns the value of attribute default_url.
-
#description_changed ⇒ Object
Returns the value of attribute description_changed.
-
#image_changed ⇒ Object
Returns the value of attribute image_changed.
-
#keywords_changed ⇒ Object
Returns the value of attribute keywords_changed.
-
#site_changed ⇒ Object
Returns the value of attribute site_changed.
-
#site_name_changed ⇒ Object
Returns the value of attribute site_name_changed.
-
#title_changed ⇒ Object
Returns the value of attribute title_changed.
-
#type_changed ⇒ Object
Returns the value of attribute type_changed.
-
#url_changed ⇒ Object
Returns the value of attribute url_changed.
Instance Method Summary collapse
-
#initialize(options) ⇒ Container
constructor
A new instance of Container.
- #reset_changed_status ⇒ Object
- #title=(value) ⇒ Object
Constructor Details
#initialize(options) ⇒ Container
Returns a new instance of Container.
45 46 47 48 49 |
# File 'lib/meta_tags/container.rb', line 45 def initialize .each do |label, value| self.send(:"default_#{ label }=", value) end end |
Instance Attribute Details
#card_changed ⇒ Object
Returns the value of attribute card_changed.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def card_changed @card_changed end |
#default_card ⇒ Object
Returns the value of attribute default_card.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def default_card @default_card end |
#default_description ⇒ Object
Returns the value of attribute default_description.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def default_description @default_description end |
#default_image ⇒ Object
Returns the value of attribute default_image.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def default_image @default_image end |
#default_keywords ⇒ Object
Returns the value of attribute default_keywords.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def default_keywords @default_keywords end |
#default_site ⇒ Object
Returns the value of attribute default_site.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def default_site @default_site end |
#default_site_name ⇒ Object
Returns the value of attribute default_site_name.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def default_site_name @default_site_name end |
#default_title ⇒ Object
Returns the value of attribute default_title.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def default_title @default_title end |
#default_type ⇒ Object
Returns the value of attribute default_type.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def default_type @default_type end |
#default_url ⇒ Object
Returns the value of attribute default_url.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def default_url @default_url end |
#description_changed ⇒ Object
Returns the value of attribute description_changed.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def description_changed @description_changed end |
#image_changed ⇒ Object
Returns the value of attribute image_changed.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def image_changed @image_changed end |
#keywords_changed ⇒ Object
Returns the value of attribute keywords_changed.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def keywords_changed @keywords_changed end |
#site_changed ⇒ Object
Returns the value of attribute site_changed.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def site_changed @site_changed end |
#site_name_changed ⇒ Object
Returns the value of attribute site_name_changed.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def site_name_changed @site_name_changed end |
#title_changed ⇒ Object
Returns the value of attribute title_changed.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def title_changed @title_changed end |
#type_changed ⇒ Object
Returns the value of attribute type_changed.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def type_changed @type_changed end |
#url_changed ⇒ Object
Returns the value of attribute url_changed.
5 6 7 |
# File 'lib/meta_tags/container.rb', line 5 def url_changed @url_changed end |
Instance Method Details
#reset_changed_status ⇒ Object
61 62 63 64 65 |
# File 'lib/meta_tags/container.rb', line 61 def reset_changed_status TAGS_LIST.each do |label| self.send(:"#{ label }_changed=", false) end end |
#title=(value) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/meta_tags/container.rb', line 51 def title=(value) @title_changed = true if default_title == value || !MetaTags.keep_default_title_present @title = value elsif MetaTags.keep_default_title_present @title = "#{ value } - #{ default_title }" end end |