lib/film_snob.rb in film_snob-0.6.5 vs lib/film_snob.rb in film_snob-1.0.0

- old
+ new

@@ -1,36 +1,32 @@ require "forwardable" require "film_snob/version" -require "film_snob/url_to_video" +require "film_snob/url_to_oembed_provider" require "film_snob/exceptions" -require "film_snob/deprecated" class FilmSnob - extend Deprecated, Forwardable + extend Forwardable - VIDEO_METHODS = [:site, :id, :clean_url, :title, :html] + MEDIA_METHODS = [:site, :id, :clean_url, :title, :html] - def_delegators :video, *VIDEO_METHODS + def_delegators :media, *MEDIA_METHODS - # TODO(2015-11-15): actually remove this method - deprecated_alias :watchable?, :embeddable?, :removed_in => "v1.0.0" - attr_reader :url def initialize(url, options = {}) @url = url - @video = UrlToVideo.new(url, options).video + @media = UrlToOembedProvider.new(url, options).media end def embeddable? - !@video.nil? + !@media.nil? end private - def video + def media if embeddable? - @video + @media else raise NotSupportedURLError, "#{url} is not a supported URL" end end end