Sha256: b14f1f5dde57d3b8f1abb61049caf19fcb33cd76dfbe6169511904534b305d93

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

require "asset_host_core/loaders/base"
require "asset_host_core/loaders/asset_host"
require "asset_host_core/loaders/youtube"
require "asset_host_core/loaders/vimeo"
require "asset_host_core/loaders/flickr"
require "asset_host_core/loaders/brightcove"
require "asset_host_core/loaders/url"

module AssetHostCore
  module Loaders

    MODULES = [
      AssetHost,
      YouTube,
      Vimeo,
      Flickr,
      Brightcove,
      URL # This needs to be last, to act as a last-resort.
    ]

    class << self
      def load(url)
        loader = nil
        MODULES.find { |klass| loader = klass.build_from_url(url) }
        loader.try(:load)
      end


      def classes
        puts "Classes: " + MODULES.to_s
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asset_host_core-2.0.0.beta lib/asset_host_core/loaders.rb