Class: Youtube::Video
- Inherits:
-
Object
- Object
- Youtube::Video
- Defined in:
- lib/youtube-downloader/youtube.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#video_id ⇒ Object
Returns the value of attribute video_id.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(url) ⇒ Video
constructor
A new instance of Video.
- #to_s ⇒ Object (also: #url)
Constructor Details
#initialize(url) ⇒ Video
Returns a new instance of Video.
14 15 16 |
# File 'lib/youtube-downloader/youtube.rb', line 14 def initialize(url) get_download_url(url) end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/youtube-downloader/youtube.rb', line 12 def id @id end |
#title ⇒ Object
Returns the value of attribute title.
10 11 12 |
# File 'lib/youtube-downloader/youtube.rb', line 10 def title @title end |
#video_id ⇒ Object
Returns the value of attribute video_id.
11 12 13 |
# File 'lib/youtube-downloader/youtube.rb', line 11 def video_id @video_id end |
Instance Method Details
#empty? ⇒ Boolean
23 24 25 |
# File 'lib/youtube-downloader/youtube.rb', line 23 def empty? title.nil? and video_id.nil? and id.nil? end |
#to_s ⇒ Object Also known as: url
18 19 20 |
# File 'lib/youtube-downloader/youtube.rb', line 18 def to_s "http://youtube.com/get_video.php?t=#{id}&video_id=#{video_id}&fmt=18" end |