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.



27
28
29
# File 'lib/acts_as_unvlogable.rb', line 27

def initialize(url=nil, options={})
  @object = VideoFactory.new(url, options).load_service
end

Instance Method Details

#download_urlObject

Deprecated



64
65
# File 'lib/acts_as_unvlogable.rb', line 64

def download_url
end

#durationObject

duration is in seconds



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

def duration # duration is in seconds
  @object.duration rescue nil
end

#embed_html(width = 425, height = 344, options = {}, params = {}) ⇒ Object



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

def embed_html(width=425, height=344, options={}, params={})
  @object.embed_html(width, height, options, params) rescue nil
end

#embed_urlObject



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

def embed_url
  @object.embed_url rescue nil
end

#flvObject

Deprecated



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

def flv
end

#serviceObject



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

def service
  @object.service rescue nil
end

#thumbnailObject



35
36
37
# File 'lib/acts_as_unvlogable.rb', line 35

def thumbnail
  @object.thumbnail rescue nil
end

#titleObject



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

def title
  @object.title rescue nil
end

#video_details(width = 425, height = 344) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/acts_as_unvlogable.rb', line 67

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 => nil,              # Deprecated
    :download_url => nil,     # Deprecated
    :service => @object.service,
    :duration => @object.duration
  }
end

#video_idObject



47
48
49
# File 'lib/acts_as_unvlogable.rb', line 47

def video_id
  @object.video_id rescue nil
end