Class: Zemus::Vimeo
- Inherits:
-
Object
- Object
- Zemus::Vimeo
- Defined in:
- lib/zemus/vimeo.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url) ⇒ Vimeo
constructor
A new instance of Vimeo.
- #to_embed ⇒ Object
Constructor Details
#initialize(url) ⇒ Vimeo
Returns a new instance of Vimeo.
8 9 10 |
# File 'lib/zemus/vimeo.rb', line 8 def initialize(url) @url = url end |
Class Method Details
.valid?(url) ⇒ Boolean
4 5 6 |
# File 'lib/zemus/vimeo.rb', line 4 def self.valid?(url) url =~ /vimeo.com/ end |
Instance Method Details
#to_embed ⇒ Object
12 13 14 15 16 |
# File 'lib/zemus/vimeo.rb', line 12 def id = @url.split('/').last "<iframe src='http://player.vimeo.com/video/#{id}' width='100%' height='600px' frameborder='0'></iframe>" end |