module FacebookSocialPlugins::Helper::OpenGraph

Public Instance Methods

fb_app_id(app_id) click to toggle source
# File lib/facebook-social_plugins/helper/open_graph.rb, line 8
def fb_app_id app_id
        content_tag :meta, '', :property => "fb:app_id", :content => app_id
end
og_desc(desc) click to toggle source
# File lib/facebook-social_plugins/helper/open_graph.rb, line 24
def og_desc desc
        content_tag :meta, '', :property => "og:description", :content => desc
end
og_header(name, namespace, &block) click to toggle source
# File lib/facebook-social_plugins/helper/open_graph.rb, line 3
def og_header name, namespace, &block
        content = capture(&block)
        content_tag :head, content, :prefix => "og: http://ogp.me/ns# og_#{name}: http://ogp.me/ns/apps/#{namespace}x#"
end
og_image(href) click to toggle source
# File lib/facebook-social_plugins/helper/open_graph.rb, line 20
def og_image href
        content_tag :meta, '', :property => "og:image", :content => href
end
og_title(title) click to toggle source
# File lib/facebook-social_plugins/helper/open_graph.rb, line 16
def og_title title
        content_tag :meta, '', :property => "og:title", :content => title
end
og_type(namespace, object_type) click to toggle source
# File lib/facebook-social_plugins/helper/open_graph.rb, line 12
def og_type namespace, object_type
        content_tag :meta, '', :property => "og:type", :content => "#{namespace}:#{object_type}"
end
og_url(href) click to toggle source
# File lib/facebook-social_plugins/helper/open_graph.rb, line 28
def og_url href
        content_tag :meta, '', :property => "og:url", :content => href
end
open_graph_meta(name, namespace, app_id, object_type, options = {}) click to toggle source
# File lib/facebook-social_plugins/helper/open_graph.rb, line 32
def open_graph_meta name, namespace, app_id, object_type, options = {}
        content = fb_app_id(app_id) + og_type(namespace, object_type)
        content << og_title(options[:title]) if options[:title]
        content << og_image(options[:img]) if options[:img]
        content << og_image(options[:desc]) if options[:desc]
        content << og_image(options[:url]) if options[:url]                          
        og_header(name, namespace) do
                content
        end
end