Class: ArticleJSON::Import::GoogleDoc::HTML::EmbeddedVimeoVideoParser
- Inherits:
-
EmbeddedParser
- Object
- EmbeddedParser
- ArticleJSON::Import::GoogleDoc::HTML::EmbeddedVimeoVideoParser
- Defined in:
- lib/article_json/import/google_doc/html/embedded_vimeo_video_parser.rb
Class Method Summary collapse
-
.url_regexp ⇒ Regexp
Regular expression to check if a given string is a Vimeo URL Can also be used to extract the ID from the URL.
Instance Method Summary collapse
-
#embed_type ⇒ Symbol
The type of this embedded element.
Methods inherited from EmbeddedParser
build, #element, #embed_id, #initialize, matches?, supported?, #tags
Methods included from Shared::Caption
Constructor Details
This class inherits a constructor from ArticleJSON::Import::GoogleDoc::HTML::EmbeddedParser
Class Method Details
.url_regexp ⇒ Regexp
Regular expression to check if a given string is a Vimeo URL Can also be used to extract the ID from the URL
16 17 18 19 20 21 22 23 |
# File 'lib/article_json/import/google_doc/html/embedded_vimeo_video_parser.rb', line 16 def url_regexp %r{ ^\S* # all protocols & sub domains vimeo\.com # domain .*([\#/]|clip_id=) # optional path & param (?<id>[\d]+) # numerical id }xi end |
Instance Method Details
#embed_type ⇒ Symbol
The type of this embedded element
8 9 10 |
# File 'lib/article_json/import/google_doc/html/embedded_vimeo_video_parser.rb', line 8 def :vimeo_video end |