class OembedProxy::GoogleMapsengine
Google Maps Engine Fauxembed
Constants
- MAPSENGINE_REGEXES
Public Instance Methods
get_data(url, _other_params = {})
click to toggle source
# File lib/oembed_proxy/google_mapsengine.rb, line 15 def get_data(url, _other_params = {}) return nil unless handles_url? url { 'type' => 'rich', 'version' => '1.0', 'provider_name' => 'Google Maps Engine', 'provider_url' => 'https://mapsengine.google.com/', 'html' => "<iframe class=\"google-map\" width=\"640\" height=\"480\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"https://mapsengine.google.com/map/embed?mid=#{url.match(get_matching_regex(url))[1]}\"></iframe>", 'width' => 500, 'height' => 500, } end
handles_url?(url)
click to toggle source
# File lib/oembed_proxy/google_mapsengine.rb, line 11 def handles_url?(url) !get_matching_regex(url).nil? end
Private Instance Methods
get_matching_regex(str)
click to toggle source
# File lib/oembed_proxy/google_mapsengine.rb, line 31 def get_matching_regex(str) MAPSENGINE_REGEXES.each do |regex| return regex unless (str =~ regex).nil? end nil end