Class: Ogpr::Model::OpenGraph

Inherits:
Base
  • Object
show all
Defined in:
lib/ogpr/model/open_graph.rb

Instance Attribute Summary

Attributes inherited from Base

#meta

Instance Method Summary collapse

Methods inherited from Base

#[], create, #each_key, #each_pair, #keys, #to_s

Constructor Details

#initialize(hash) ⇒ OpenGraph

Returns a new instance of OpenGraph.



8
9
10
11
# File 'lib/ogpr/model/open_graph.rb', line 8

def initialize(hash)
  super hash.select { |k, _| k =~ /^og:\w+/ }
  @prefix = 'og'
end

Instance Method Details

#typeObject



13
14
15
# File 'lib/ogpr/model/open_graph.rb', line 13

def type
  @meta['og:type']
end