pupilfirst/pupilfirst

View on GitHub
lib/oembed/google_slides_fallback_provider.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module Oembed
  class GoogleSlidesFallbackProvider < BaseFallbackProvider
    def self.domains
      [/docs\.google\.com/]
    end

    def self.paths
      [
        /^\/presentation\/.*\/pub/
      ]
    end

    def resource_url
      # Replace '/pub' with '/embed'.
      @resource_url.gsub('/pub', '/embed')
    end
  end
end