Class: UnvlogIt
Defined Under Namespace
Classes: VideoFactory
Instance Method Summary collapse
- #download_url ⇒ Object
-
#duration ⇒ Object
duration is in seconds.
- #embed_html(width = 425, height = 344, options = {}, params = {}) ⇒ Object
- #embed_url ⇒ Object
- #flv ⇒ Object
-
#initialize(url = nil, options = {}) ⇒ UnvlogIt
constructor
A new instance of UnvlogIt.
- #service ⇒ Object
- #thumbnail ⇒ Object
- #title ⇒ Object
- #video_details(width = 425, height = 344) ⇒ Object
- #video_id ⇒ Object
Constructor Details
#initialize(url = nil, options = {}) ⇒ UnvlogIt
Returns a new instance of UnvlogIt.
24 25 26 |
# File 'lib/acts_as_unvlogable.rb', line 24 def initialize(url=nil, ={}) @object = VideoFactory.new(url, ).load_service end |
Instance Method Details
#download_url ⇒ Object
56 57 58 |
# File 'lib/acts_as_unvlogable.rb', line 56 def download_url @object.download_url rescue nil end |
#duration ⇒ Object
duration is in seconds
36 37 38 |
# File 'lib/acts_as_unvlogable.rb', line 36 def duration # duration is in seconds @object.duration rescue nil end |
#embed_html(width = 425, height = 344, options = {}, params = {}) ⇒ Object
48 49 50 |
# File 'lib/acts_as_unvlogable.rb', line 48 def (width=425, height=344, ={}, params={}) @object.(width, height, , params) rescue nil end |
#embed_url ⇒ Object
40 41 42 |
# File 'lib/acts_as_unvlogable.rb', line 40 def @object. rescue nil end |
#flv ⇒ Object
52 53 54 |
# File 'lib/acts_as_unvlogable.rb', line 52 def flv @object.flv #rescue nil end |
#service ⇒ Object
60 61 62 |
# File 'lib/acts_as_unvlogable.rb', line 60 def service @object.service rescue nil end |
#thumbnail ⇒ Object
32 33 34 |
# File 'lib/acts_as_unvlogable.rb', line 32 def thumbnail @object.thumbnail rescue nil end |
#title ⇒ Object
28 29 30 |
# File 'lib/acts_as_unvlogable.rb', line 28 def title @object.title #rescue nil end |
#video_details(width = 425, height = 344) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/acts_as_unvlogable.rb', line 64 def video_details(width=425, height=344) { :title => @object.title, :thumbnail => @object.thumbnail, :embed_url => @object., :embed_html => @object.(width, height), :flv => @object.flv, :download_url => @object.download_url, :service => @object.service, :duration => @object.duration } end |
#video_id ⇒ Object
44 45 46 |
# File 'lib/acts_as_unvlogable.rb', line 44 def video_id @object.video_id rescue nil end |