Class: Onebox::Oembed
- Inherits:
-
OpenGraph
- Object
- Normalizer
- OpenGraph
- Onebox::Oembed
- Defined in:
- lib/onebox/oembed.rb
Instance Attribute Summary
Attributes inherited from Normalizer
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(response) ⇒ Oembed
constructor
A new instance of Oembed.
Methods inherited from OpenGraph
#secure_image_url, #title, #title_attr
Methods inherited from Normalizer
Constructor Details
#initialize(response) ⇒ Oembed
Returns a new instance of Oembed.
5 6 7 8 9 10 |
# File 'lib/onebox/oembed.rb', line 5 def initialize(response) @data = ::MultiJson.load(response, symbolize_keys: true) # never use oembed from WordPress 4.4 (it's broken) @data.delete(:html) if @data[:html] && @data[:html]["wp-embedded-content"] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Onebox::Normalizer
Instance Method Details
#html ⇒ Object
12 13 14 |
# File 'lib/onebox/oembed.rb', line 12 def html get(:html, nil, false) end |