class OpenGraph::Object

The OpenGraph::Object is a Hash with method accessors for all detected Open Graph attributes.

Constants

MANDATORY_ATTRIBUTES

Public Instance Methods

schema() click to toggle source

The schema under which this particular object lies. May be any of the keys of the TYPES constant.

# File lib/urifetch/ext/opengraph.rb, line 44
def schema
  OpenGraph::TYPES.each_pair do |schema, types| 
    return schema if types.include?(self.type)
  end
  nil
end
type() click to toggle source

The object type.

# File lib/urifetch/ext/opengraph.rb, line 38
def type
  self['type']
end
valid?() click to toggle source

If the Open Graph information for this object doesn't contain the mandatory attributes, this will be false.

# File lib/urifetch/ext/opengraph.rb, line 65
def valid?
  MANDATORY_ATTRIBUTES.each{|a| return false unless self[a]}
  true
end