Class: Embedit::GoogleVideo
- Inherits:
-
Object
- Object
- Embedit::GoogleVideo
- Defined in:
- lib/embedit/providers/google_video.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #doc_id ⇒ Object
- #html(options = {}) ⇒ Object
-
#initialize(url) ⇒ GoogleVideo
constructor
A new instance of GoogleVideo.
Constructor Details
#initialize(url) ⇒ GoogleVideo
Returns a new instance of GoogleVideo.
7 8 9 10 |
# File 'lib/embedit/providers/google_video.rb', line 7 def initialize(url) @url = url @format = "video" end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
5 6 7 |
# File 'lib/embedit/providers/google_video.rb', line 5 def format @format end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/embedit/providers/google_video.rb', line 5 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/embedit/providers/google_video.rb', line 5 def url @url end |
Class Method Details
.match(url) ⇒ Object
27 28 29 |
# File 'lib/embedit/providers/google_video.rb', line 27 def self.match(url) url.match(/video\.google\.com\/videoplay\?docid=-(\w+)/) end |
Instance Method Details
#doc_id ⇒ Object
17 18 19 |
# File 'lib/embedit/providers/google_video.rb', line 17 def doc_id @url[/video\.google\.com\/videoplay\?docid=-(\w+)/,1] end |
#html(options = {}) ⇒ Object
12 13 14 15 |
# File 'lib/embedit/providers/google_video.rb', line 12 def html(={}) .reverse_merge!(:width=>400, :height=>326) %{<embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=-#{doc_id}&hl=en&fs=true" style="width:#{options[:width]}px;height:#{options[:height]}px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"> </embed>} end |