Class: RichUrls::Parsers::EmbedParser::Youtube
- Inherits:
-
Base
- Object
- Base
- RichUrls::Parsers::EmbedParser::Youtube
show all
- Defined in:
- lib/parsers/embed_parsers/youtube.rb
Constant Summary
collapse
- IFRAME =
'<iframe width="560" height="315" '\
'src="https://www.youtube.com/embed/%s" frameborder="0" '\
'allow="accelerometer; autoplay; encrypted-media; '\
'gyroscope; picture-in-picture" allowfullscreen>'\
'</iframe>'.freeze
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#match? ⇒ Boolean
11
12
13
14
15
|
# File 'lib/parsers/embed_parsers/youtube.rb', line 11
def match?
@uri.host == 'www.youtube.com' &&
@uri.path == '/watch' &&
query.key?('v')
end
|
#parse ⇒ Object
17
18
19
|
# File 'lib/parsers/embed_parsers/youtube.rb', line 17
def parse
IFRAME % query.fetch('v')
end
|