Class: M3u8::Reader
Overview
Reader provides parsing of m3u8 playlists
Constant Summary
Constants included from M3u8
Instance Attribute Summary collapse
-
#item ⇒ Object
Returns the value of attribute item.
-
#master ⇒ Object
Returns the value of attribute master.
-
#open ⇒ Object
Returns the value of attribute open.
-
#playlist ⇒ Object
Returns the value of attribute playlist.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize ⇒ Reader
constructor
A new instance of Reader.
- #read(input) ⇒ Object
Methods included from M3u8
#intialize_with_byterange, #parse_attributes, #parse_float, #parse_yes_no, #to_yes_no
Constructor Details
#initialize ⇒ Reader
Returns a new instance of Reader.
8 9 10 11 12 13 14 |
# File 'lib/m3u8/reader.rb', line 8 def initialize(*) = [, , , , ].inject(:merge) end |
Instance Attribute Details
#item ⇒ Object
Returns the value of attribute item.
6 7 8 |
# File 'lib/m3u8/reader.rb', line 6 def item @item end |
#master ⇒ Object
Returns the value of attribute master.
6 7 8 |
# File 'lib/m3u8/reader.rb', line 6 def master @master end |
#open ⇒ Object
Returns the value of attribute open.
6 7 8 |
# File 'lib/m3u8/reader.rb', line 6 def open @open end |
#playlist ⇒ Object
Returns the value of attribute playlist.
6 7 8 |
# File 'lib/m3u8/reader.rb', line 6 def playlist @playlist end |
#tags ⇒ Object
Returns the value of attribute tags.
6 7 8 |
# File 'lib/m3u8/reader.rb', line 6 def end |
Instance Method Details
#read(input) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/m3u8/reader.rb', line 16 def read(input) @playlist = Playlist.new input.each_line.with_index do |line, index| validate_file_format(line) if index.zero? parse_line(line) end playlist end |