Class: OpenGraphPlus::Tags::OpenGraph

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#each, #render_in, #update

Constructor Details

#initializeOpenGraph

Returns a new instance of OpenGraph.



81
82
83
# File 'lib/opengraphplus/tags.rb', line 81

def initialize
  @type = "website"
end

Instance Attribute Details

#audioObject

Returns the value of attribute audio.



76
77
78
# File 'lib/opengraphplus/tags.rb', line 76

def audio
  @audio
end

#descriptionObject

Returns the value of attribute description.



76
77
78
# File 'lib/opengraphplus/tags.rb', line 76

def description
  @description
end

#determinerObject

Returns the value of attribute determiner.



76
77
78
# File 'lib/opengraphplus/tags.rb', line 76

def determiner
  @determiner
end

#localeObject

Returns the value of attribute locale.



76
77
78
# File 'lib/opengraphplus/tags.rb', line 76

def locale
  @locale
end

#site_nameObject

Returns the value of attribute site_name.



76
77
78
# File 'lib/opengraphplus/tags.rb', line 76

def site_name
  @site_name
end

#titleObject

Returns the value of attribute title.



76
77
78
# File 'lib/opengraphplus/tags.rb', line 76

def title
  @title
end

#typeObject

Returns the value of attribute type.



76
77
78
# File 'lib/opengraphplus/tags.rb', line 76

def type
  @type
end

#urlObject

Returns the value of attribute url.



76
77
78
# File 'lib/opengraphplus/tags.rb', line 76

def url
  @url
end

#videoObject

Returns the value of attribute video.



76
77
78
# File 'lib/opengraphplus/tags.rb', line 76

def video
  @video
end

Instance Method Details

#imageObject



78
# File 'lib/opengraphplus/tags.rb', line 78

def image = @image ||= Image.new

#image_url=(url) ⇒ Object



85
86
87
88
# File 'lib/opengraphplus/tags.rb', line 85

def image_url=(url)
  image.url = url
  image.secure_url = url
end

#plusObject



79
# File 'lib/opengraphplus/tags.rb', line 79

def plus = @plus ||= Plus.new

#tagsObject



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/opengraphplus/tags.rb', line 90

def tags
  [
    Tag.new("og:title", title),
    Tag.new("og:description", description),
    Tag.new("og:url", url),
    Tag.new("og:type", type),
    Tag.new("og:site_name", site_name),
    Tag.new("og:locale", locale),
    Tag.new("og:determiner", determiner),
    Tag.new("og:audio", audio),
    Tag.new("og:video", video),
    image,
    plus,
  ]
end