Class: RichUrls::Parsers::EmbedParser::YoutubeShort

Inherits:
Base
  • Object
show all
Defined in:
lib/parsers/embed_parsers/youtube_short.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from RichUrls::Parsers::EmbedParser::Base

Instance Method Details

#match?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/parsers/embed_parsers/youtube_short.rb', line 5

def match?
  @uri.host == 'youtu.be'
end

#parseObject



9
10
11
12
13
14
# File 'lib/parsers/embed_parsers/youtube_short.rb', line 9

def parse
  path = @uri.path
  path[0] = ''

  Youtube::IFRAME % path
end