Class: EmbedRb::YouTube
- Inherits:
-
Object
- Object
- EmbedRb::YouTube
- Includes:
- Base
- Defined in:
- lib/embedrb/video/embed_youtube.rb
Instance Method Summary collapse
-
#initialize(input, output, options, embeds) ⇒ YouTube
constructor
A new instance of YouTube.
Methods included from Base
Constructor Details
#initialize(input, output, options, embeds) ⇒ YouTube
Returns a new instance of YouTube.
8 9 10 11 12 13 14 15 |
# File 'lib/embedrb/video/embed_youtube.rb', line 8 def initialize(input, output, , ) @input = input @output = output = = @regex = /(https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[?=&+%\w-]*)/mi @service = :youtube end |