Class: UnvlogIt

Inherits:
Object show all
Defined in:
lib/acts_as_unvlogable.rb

Defined Under Namespace

Classes: VideoFactory

Instance Method Summary collapse

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, options={})
  @object = VideoFactory.new(url, options).load_service
end

Instance Method Details

#download_urlObject



56
57
58
# File 'lib/acts_as_unvlogable.rb', line 56

def download_url
  @object.download_url rescue nil
end

#durationObject

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 embed_html(width=425, height=344, options={}, params={})
  @object.embed_html(width, height, options, params) rescue nil
end

#embed_urlObject



40
41
42
# File 'lib/acts_as_unvlogable.rb', line 40

def embed_url
  @object.embed_url rescue nil
end

#flvObject



52
53
54
# File 'lib/acts_as_unvlogable.rb', line 52

def flv
  @object.flv #rescue nil
end

#serviceObject



60
61
62
# File 'lib/acts_as_unvlogable.rb', line 60

def service
  @object.service rescue nil
end

#thumbnailObject



32
33
34
# File 'lib/acts_as_unvlogable.rb', line 32

def thumbnail
  @object.thumbnail rescue nil
end

#titleObject



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_url,
    :embed_html => @object.embed_html(width, height),
    :flv => @object.flv,
    :download_url => @object.download_url,
    :service => @object.service,
    :duration => @object.duration
  }
end

#video_idObject



44
45
46
# File 'lib/acts_as_unvlogable.rb', line 44

def video_id
  @object.video_id rescue nil
end