Class: M3u8::Playlist
- Inherits:
-
Object
- Object
- M3u8::Playlist
- Defined in:
- lib/m3u8/playlist.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#items ⇒ Object
Returns the value of attribute items.
-
#sequence ⇒ Object
Returns the value of attribute sequence.
-
#target ⇒ Object
Returns the value of attribute target.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Playlist
constructor
A new instance of Playlist.
- #master? ⇒ Boolean
- #to_s ⇒ Object
- #valid? ⇒ Boolean
- #write(output) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Playlist
Returns a new instance of Playlist.
5 6 7 8 |
# File 'lib/m3u8/playlist.rb', line 5 def initialize( = {}) self.items = [] end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
3 4 5 |
# File 'lib/m3u8/playlist.rb', line 3 def cache @cache end |
#items ⇒ Object
Returns the value of attribute items.
3 4 5 |
# File 'lib/m3u8/playlist.rb', line 3 def items @items end |
#sequence ⇒ Object
Returns the value of attribute sequence.
3 4 5 |
# File 'lib/m3u8/playlist.rb', line 3 def sequence @sequence end |
#target ⇒ Object
Returns the value of attribute target.
3 4 5 |
# File 'lib/m3u8/playlist.rb', line 3 def target @target end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/m3u8/playlist.rb', line 3 def version @version end |
Class Method Details
.codecs(options = {}) ⇒ Object
10 11 12 13 |
# File 'lib/m3u8/playlist.rb', line 10 def self.codecs( = {}) item = PlaylistItem.new item.codecs end |
Instance Method Details
#master? ⇒ Boolean
25 26 27 28 |
# File 'lib/m3u8/playlist.rb', line 25 def master? return false if playlist_size == 0 && segment_size == 0 playlist_size > 0 end |
#to_s ⇒ Object
30 31 32 33 34 |
# File 'lib/m3u8/playlist.rb', line 30 def to_s output = StringIO.open write output output.string end |
#valid? ⇒ Boolean
36 37 38 39 |
# File 'lib/m3u8/playlist.rb', line 36 def valid? return false if playlist_size > 0 && segment_size > 0 true end |