Class: VideoEmbed::YouTube

Inherits:
Object
  • Object
show all
Defined in:
lib/video_embed/youtube.rb

Defined Under Namespace

Classes: Url

Instance Method Summary collapse

Instance Method Details

#embed(url, options = {}) ⇒ Object



9
10
11
12
# File 'lib/video_embed/youtube.rb', line 9

def embed(url, options = {})
  youtube_url = YouTube::Url.new(url, options)
  youtube_url.embed
end

#url?(url) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/video_embed/youtube.rb', line 5

def url?(url)
  url.host =~ /(:?youtube\.com|youtu.be)/
end