Class: Onebox::Oembed

Inherits:
OpenGraph show all
Defined in:
lib/onebox/oembed.rb

Instance Attribute Summary

Attributes inherited from OpenGraph

#data

Instance Method Summary collapse

Methods inherited from OpenGraph

#get, #get_secure_image, #method_missing, #title, #title_attr

Constructor Details

#initialize(response) ⇒ Oembed

Returns a new instance of Oembed.



6
7
8
9
10
11
# File 'lib/onebox/oembed.rb', line 6

def initialize(response)
  @data = Onebox::Helpers.symbolize_keys(::MultiJson.load(response))

  # 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::OpenGraph

Instance Method Details

#htmlObject



13
14
15
# File 'lib/onebox/oembed.rb', line 13

def html
  get(:html, nil, false)
end