Class: VideoInfo::Providers::Vimeo
- Inherits:
-
VideoInfo::Provider
- Object
- VideoInfo::Provider
- VideoInfo::Providers::Vimeo
- Defined in:
- lib/video_info/providers/vimeo.rb
Instance Attribute Summary
Attributes inherited from VideoInfo::Provider
#data, #options, #url, #video_id
Class Method Summary collapse
Instance Method Summary collapse
- #embed_url ⇒ Object
-
#initialize(url, options = {}) ⇒ Vimeo
constructor
A new instance of Vimeo.
- #provider ⇒ Object
Methods inherited from VideoInfo::Provider
#available?, #embed_code, #stats, #thumbnail, #thumbnail_large_2x, #thumbnail_maxres
Constructor Details
#initialize(url, options = {}) ⇒ Vimeo
Returns a new instance of Vimeo.
7 8 9 10 11 12 13 14 15 |
# File 'lib/video_info/providers/vimeo.rb', line 7 def initialize(url, = {}) if VideoInfo.provider_api_keys[:vimeo].nil? extend VimeoScraper else extend VimeoAPI end super(url, ) end |
Class Method Details
.usable?(url) ⇒ Boolean
17 18 19 |
# File 'lib/video_info/providers/vimeo.rb', line 17 def self.usable?(url) url.match?(%r{(vimeo\.com/(?!album|hubnut/album|user\d+/?\z).*)}) end |
Instance Method Details
#embed_url ⇒ Object
25 26 27 |
# File 'lib/video_info/providers/vimeo.rb', line 25 def "//player.vimeo.com/video/#{video_id}" end |
#provider ⇒ Object
21 22 23 |
# File 'lib/video_info/providers/vimeo.rb', line 21 def provider "Vimeo" end |