Class: Ogpr::Model::OpenGraph
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(hash) ⇒ OpenGraph
constructor
A new instance of OpenGraph.
- #type ⇒ Object
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
#type ⇒ Object
13 14 15 |
# File 'lib/ogpr/model/open_graph.rb', line 13 def type @meta['og:type'] end |