Class: FilmSnob

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/film_snob.rb,
lib/film_snob/version.rb,
lib/film_snob/exceptions.rb,
lib/film_snob/oembed_provider.rb,
lib/film_snob/oembed_providers/coub.rb,
lib/film_snob/oembed_providers/hulu.rb,
lib/film_snob/oembed_providers/vine.rb,
lib/film_snob/oembed_providers/vimeo.rb,
lib/film_snob/url_to_oembed_provider.rb,
lib/film_snob/oembed_providers/rutube.rb,
lib/film_snob/oembed_providers/youtube.rb,
lib/film_snob/oembed_providers/instagram.rb,
lib/film_snob/oembed_providers/soundcloud.rb,
lib/film_snob/oembed_providers/dailymotion.rb,
lib/film_snob/oembed_providers/funny_or_die.rb

Defined Under Namespace

Classes: Coub, Dailymotion, FilmSnobError, FunnyOrDie, Hulu, Instagram, NotEmbeddableError, NotSupportedURLError, OembedProvider, Rutube, Soundcloud, UrlToOembedProvider, Vimeo, Vine, YouTube

Constant Summary collapse

MEDIA_METHODS =
[:site, :id, :clean_url, :title, :html].freeze
VERSION =
"2.0.0".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options = {}) ⇒ FilmSnob

Returns a new instance of FilmSnob.



15
16
17
18
# File 'lib/film_snob.rb', line 15

def initialize(url, options = {})
  @url = url
  @media = UrlToOembedProvider.new(url, options).media
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



13
14
15
# File 'lib/film_snob.rb', line 13

def url
  @url
end

Instance Method Details

#embeddable?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/film_snob.rb', line 20

def embeddable?
  !@media.nil?
end