Class: OpenGraphPlus::Namespace::Twitter
- Defined in:
- lib/opengraphplus/namespace.rb
Defined Under Namespace
Classes: Image
Instance Attribute Summary collapse
-
#card ⇒ Object
Returns the value of attribute card.
-
#creator ⇒ Object
Returns the value of attribute creator.
-
#description ⇒ Object
Returns the value of attribute description.
-
#site ⇒ Object
Returns the value of attribute site.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #image ⇒ Object
- #image_url=(url) ⇒ Object
-
#initialize ⇒ Twitter
constructor
A new instance of Twitter.
- #tags ⇒ Object
Methods inherited from Base
#each, #render_in, #tag, #update
Constructor Details
#initialize ⇒ Twitter
Returns a new instance of Twitter.
133 134 135 |
# File 'lib/opengraphplus/namespace.rb', line 133 def initialize @card = "summary_large_image" end |
Instance Attribute Details
#card ⇒ Object
Returns the value of attribute card.
131 132 133 |
# File 'lib/opengraphplus/namespace.rb', line 131 def card @card end |
#creator ⇒ Object
Returns the value of attribute creator.
131 132 133 |
# File 'lib/opengraphplus/namespace.rb', line 131 def creator @creator end |
#description ⇒ Object
Returns the value of attribute description.
131 132 133 |
# File 'lib/opengraphplus/namespace.rb', line 131 def description @description end |
#site ⇒ Object
Returns the value of attribute site.
131 132 133 |
# File 'lib/opengraphplus/namespace.rb', line 131 def site @site end |
#title ⇒ Object
Returns the value of attribute title.
131 132 133 |
# File 'lib/opengraphplus/namespace.rb', line 131 def title @title end |
Instance Method Details
#image ⇒ Object
137 138 139 |
# File 'lib/opengraphplus/namespace.rb', line 137 def image @image ||= Image.new end |
#image_url=(url) ⇒ Object
141 142 143 |
# File 'lib/opengraphplus/namespace.rb', line 141 def image_url=(url) image.url = url end |
#tags ⇒ Object
145 146 147 148 149 150 151 152 153 154 |
# File 'lib/opengraphplus/namespace.rb', line 145 def [ tag("twitter:card", card), tag("twitter:site", site), tag("twitter:creator", creator), tag("twitter:title", title), tag("twitter:description", description), *image. ].compact end |