Class: Videodrome::Video
- Inherits:
-
Object
- Object
- Videodrome::Video
- Defined in:
- lib/videodrome/video.rb
Overview
Video wrapper for Youtube info
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#player ⇒ Object
readonly
Returns the value of attribute player.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
-
#snippet ⇒ Object
readonly
Returns the value of attribute snippet.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #description ⇒ Object
- #duration ⇒ Object
- #embed_html ⇒ Object
- #embeddable ⇒ Object
-
#initialize(url, options = {}) ⇒ Video
constructor
A new instance of Video.
- #published_at ⇒ Object
- #thumbnail(size = "standard") ⇒ Object
- #thumbnails ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(url, options = {}) ⇒ Video
Returns a new instance of Video.
9 10 11 12 13 14 |
# File 'lib/videodrome/video.rb', line 9 def initialize(url, = {}) @url = URL.new(url) @id = @url.id @raw_data = Videodrome.connection.get(.merge(:id => @id)) parse_raw_data end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
7 8 9 |
# File 'lib/videodrome/video.rb', line 7 def details @details end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/videodrome/video.rb', line 7 def id @id end |
#player ⇒ Object (readonly)
Returns the value of attribute player.
7 8 9 |
# File 'lib/videodrome/video.rb', line 7 def player @player end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
7 8 9 |
# File 'lib/videodrome/video.rb', line 7 def raw_data @raw_data end |
#snippet ⇒ Object (readonly)
Returns the value of attribute snippet.
7 8 9 |
# File 'lib/videodrome/video.rb', line 7 def snippet @snippet end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/videodrome/video.rb', line 7 def status @status end |
Instance Method Details
#description ⇒ Object
24 25 26 |
# File 'lib/videodrome/video.rb', line 24 def description snippet.description end |
#duration ⇒ Object
40 41 42 |
# File 'lib/videodrome/video.rb', line 40 def duration details.duration end |
#embed_html ⇒ Object
36 37 38 |
# File 'lib/videodrome/video.rb', line 36 def player. if end |
#embeddable ⇒ Object
44 45 46 |
# File 'lib/videodrome/video.rb', line 44 def status. end |
#published_at ⇒ Object
16 17 18 |
# File 'lib/videodrome/video.rb', line 16 def published_at Time.iso8601(snippet.publishedAt) end |
#thumbnail(size = "standard") ⇒ Object
32 33 34 |
# File 'lib/videodrome/video.rb', line 32 def thumbnail(size = "standard") thumbnails[size] end |
#thumbnails ⇒ Object
28 29 30 |
# File 'lib/videodrome/video.rb', line 28 def thumbnails snippet.thumbnails end |
#title ⇒ Object
20 21 22 |
# File 'lib/videodrome/video.rb', line 20 def title snippet.title end |