Class: EmbeddedURL::Vimeo
- Inherits:
-
Object
- Object
- EmbeddedURL::Vimeo
- Defined in:
- lib/embedded_url/vimeo.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url) ⇒ Vimeo
constructor
A new instance of Vimeo.
- #to_embedded ⇒ Object
Constructor Details
#initialize(url) ⇒ Vimeo
Returns a new instance of Vimeo.
6 7 8 |
# File 'lib/embedded_url/vimeo.rb', line 6 def initialize(url) self.url = url end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/embedded_url/vimeo.rb', line 4 def url @url end |
Instance Method Details
#to_embedded ⇒ Object
10 11 12 13 14 15 |
# File 'lib/embedded_url/vimeo.rb', line 10 def if url =~ /vimeo\.com/ video_id = url.split("/").last "<object type=\"application/x-shockwave-flash\" width=\"400\" height=\"300\" data=\"http://vimeo.com/moogaloop.swf?clip_id=#{video_id}&server=vimeo.com&fullscreen=1&show_title=1&show_byline=0&show_portrait=0&color=00ADEF\"><param name=\"quality\" value=\"best\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"scale\" value=\"showAll\" /><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id=#{video_id}&server=vimeo.com&fullscreen=1&show_title=1&show_byline=0&show_portrait=0&color=00ADEF\" /><embed src=\"http://www.vimeo.com/moogaloop.swf?clip_id=#{video_id}&server=www.vimeo.com&show_title=1&show_byline=0&show_portrait=0&color=00ADEF&fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"400\" height=\"300\"></embed></object>" end end |