Class: OpenGraphPlus::Namespace::Twitter

Inherits:
Base
  • Object
show all
Defined in:
lib/opengraphplus/namespace.rb

Defined Under Namespace

Classes: Image

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#each, #render_in, #tag, #update

Constructor Details

#initializeTwitter

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

#cardObject

Returns the value of attribute card.



131
132
133
# File 'lib/opengraphplus/namespace.rb', line 131

def card
  @card
end

#creatorObject

Returns the value of attribute creator.



131
132
133
# File 'lib/opengraphplus/namespace.rb', line 131

def creator
  @creator
end

#descriptionObject

Returns the value of attribute description.



131
132
133
# File 'lib/opengraphplus/namespace.rb', line 131

def description
  @description
end

#siteObject

Returns the value of attribute site.



131
132
133
# File 'lib/opengraphplus/namespace.rb', line 131

def site
  @site
end

#titleObject

Returns the value of attribute title.



131
132
133
# File 'lib/opengraphplus/namespace.rb', line 131

def title
  @title
end

Instance Method Details

#imageObject



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

#tagsObject



145
146
147
148
149
150
151
152
153
154
# File 'lib/opengraphplus/namespace.rb', line 145

def tags
  [
    tag("twitter:card", card),
    tag("twitter:site", site),
    tag("twitter:creator", creator),
    tag("twitter:title", title),
    tag("twitter:description", description),
    *image.tags
  ].compact
end