Class: OpenGraphPlus::Namespace::OG
- Defined in:
- lib/opengraphplus/namespace.rb
Instance Attribute Summary collapse
-
#audio ⇒ Object
Returns the value of attribute audio.
-
#description ⇒ Object
Returns the value of attribute description.
-
#determiner ⇒ Object
Returns the value of attribute determiner.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#site_name ⇒ Object
Returns the value of attribute site_name.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#video ⇒ Object
Returns the value of attribute video.
Instance Method Summary collapse
- #image ⇒ Object
- #image_url=(url) ⇒ Object
-
#initialize ⇒ OG
constructor
A new instance of OG.
- #plus ⇒ Object
- #tags ⇒ Object
Methods inherited from Base
#each, #render_in, #tag, #update
Constructor Details
#initialize ⇒ OG
Returns a new instance of OG.
85 86 87 |
# File 'lib/opengraphplus/namespace.rb', line 85 def initialize @type = "website" end |
Instance Attribute Details
#audio ⇒ Object
Returns the value of attribute audio.
83 84 85 |
# File 'lib/opengraphplus/namespace.rb', line 83 def audio @audio end |
#description ⇒ Object
Returns the value of attribute description.
83 84 85 |
# File 'lib/opengraphplus/namespace.rb', line 83 def description @description end |
#determiner ⇒ Object
Returns the value of attribute determiner.
83 84 85 |
# File 'lib/opengraphplus/namespace.rb', line 83 def determiner @determiner end |
#locale ⇒ Object
Returns the value of attribute locale.
83 84 85 |
# File 'lib/opengraphplus/namespace.rb', line 83 def locale @locale end |
#site_name ⇒ Object
Returns the value of attribute site_name.
83 84 85 |
# File 'lib/opengraphplus/namespace.rb', line 83 def site_name @site_name end |
#title ⇒ Object
Returns the value of attribute title.
83 84 85 |
# File 'lib/opengraphplus/namespace.rb', line 83 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
83 84 85 |
# File 'lib/opengraphplus/namespace.rb', line 83 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
83 84 85 |
# File 'lib/opengraphplus/namespace.rb', line 83 def url @url end |
#video ⇒ Object
Returns the value of attribute video.
83 84 85 |
# File 'lib/opengraphplus/namespace.rb', line 83 def video @video end |
Instance Method Details
#image ⇒ Object
89 90 91 |
# File 'lib/opengraphplus/namespace.rb', line 89 def image @image ||= Image.new end |
#image_url=(url) ⇒ Object
97 98 99 100 |
# File 'lib/opengraphplus/namespace.rb', line 97 def image_url=(url) image.url = url image.secure_url = url end |
#plus ⇒ Object
93 94 95 |
# File 'lib/opengraphplus/namespace.rb', line 93 def plus @plus ||= Plus.new end |
#tags ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/opengraphplus/namespace.rb', line 102 def [ tag("og:title", title), tag("og:description", description), tag("og:url", url), tag("og:type", type), tag("og:site_name", site_name), tag("og:locale", locale), tag("og:determiner", determiner), tag("og:audio", audio), tag("og:video", video), *image., *plus. ].compact end |