Class: Embedit::Flv
- Inherits:
-
Object
- Object
- Embedit::Flv
- Defined in:
- lib/embedit/providers/flv.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
- #html(options = {}) ⇒ Object
- #html=(url) ⇒ Object
-
#initialize(url) ⇒ Flv
constructor
A new instance of Flv.
Constructor Details
#initialize(url) ⇒ Flv
Returns a new instance of Flv.
7 8 9 10 11 |
# File 'lib/embedit/providers/flv.rb', line 7 def initialize(url) @url = url @format = "video" self.html = url end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
5 6 7 |
# File 'lib/embedit/providers/flv.rb', line 5 def format @format end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/embedit/providers/flv.rb', line 5 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/embedit/providers/flv.rb', line 5 def url @url end |
Class Method Details
.match(url) ⇒ Object
25 26 27 |
# File 'lib/embedit/providers/flv.rb', line 25 def self.match(url) url.match(/(.+\.flv$)/) end |
Instance Method Details
#html(options = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/embedit/providers/flv.rb', line 13 def html( = {}) @html.gsub!(/height="\d+"/, %{height="#{options[:height].to_s}"}) unless [:height].nil? @html.gsub!(/width="\d+"/, %{width="#{options[:width].to_s}"}) unless [:width].nil? @html end |
#html=(url) ⇒ Object
19 20 21 22 23 |
# File 'lib/embedit/providers/flv.rb', line 19 def html=(url) @html = %{<embed src="http://s3.amazonaws.com/panda-test/player.swf" width="400" height="300" allowfullscreen="true" allowscriptaccess="always" flashvars="&displayheight=300&file=#{url}&width=400&height=300" />} end |