Sha256: 05b0459059f1c34846e1a7db093c77ce349eae2206bee17e4cd81e0ec368e227

Contents?: true

Size: 509 Bytes

Versions: 3

Compression:

Stored size: 509 Bytes

Contents

require "film_snob/oembed_provider"

class FilmSnob
  class Soundcloud < OembedProvider
    def initialize(url, options = {})
      super(url, options.merge(:format => :json))
    end

    def self.valid_url_patterns
      [
        %r{https?://soundcloud.com/([^/]+/[^?]+)},
        %r{https?://m.soundcloud.com/([^/]+/[^?]+)}
      ]
    end

    def self.oembed_endpoint
      "https://soundcloud.com/oembed"
    end

    def clean_url
      @clean_url ||= "https://soundcloud.com/#{id}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
film_snob-2.0.0 lib/film_snob/oembed_providers/soundcloud.rb
film_snob-1.0.1 lib/film_snob/oembed_providers/soundcloud.rb
film_snob-1.0.0 lib/film_snob/oembed_providers/soundcloud.rb