Class: OembedProxy::Embedly
- Inherits:
-
FirstParty
- Object
- FirstParty
- OembedProxy::Embedly
- Defined in:
- lib/oembed_proxy/embedly.rb
Overview
Embedly provider
Constant Summary collapse
- EMBEDLY_URL =
'https://api.embed.ly/1/oembed'
Constants inherited from FirstParty
Instance Method Summary collapse
- #get_data(url, other_params = {}) ⇒ Object
-
#initialize(embedly_key) ⇒ Embedly
constructor
A new instance of Embedly.
Methods inherited from FirstParty
Constructor Details
#initialize(embedly_key) ⇒ Embedly
Returns a new instance of Embedly.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/oembed_proxy/embedly.rb', line 11 def initialize() # Import the expected embed.ly providers. @pattern_hash = {} @embedly_key = File.open(File.('../providers/embedly_patterns.def', __dir__), 'r') do |f| f.each do |line| regex = Utility.clean_pattern(line) @pattern_hash[regex] = EMBEDLY_URL end end end |
Instance Method Details
#get_data(url, other_params = {}) ⇒ Object
24 25 26 27 |
# File 'lib/oembed_proxy/embedly.rb', line 24 def get_data(url, other_params = {}) other_params[:key] = @embedly_key super end |