lib/m3u8.rb in m3u8-0.5.3 vs lib/m3u8.rb in m3u8-0.6.1
- old
+ new
@@ -3,12 +3,15 @@
require 'm3u8/playlist'
require 'm3u8/playlist_item'
require 'm3u8/segment_item'
require 'm3u8/discontinuity_item'
require 'm3u8/key_item'
+require 'm3u8/map_item'
require 'm3u8/media_item'
+require 'm3u8/time_item'
require 'm3u8/session_data_item'
+require 'm3u8/byte_range'
require 'm3u8/reader'
require 'm3u8/writer'
require 'm3u8/error'
# M3u8 provides parsing, generation, and validation of m3u8 playlists
@@ -18,7 +21,14 @@
Hash[array.map { |key, value| [key, value.gsub('"', '')] }]
end
def parse_yes_no(value)
value == 'YES' ? true : false
+ end
+
+ def intialize_with_byterange(params = {})
+ params.each do |key, value|
+ value = ByteRange.new(value) if value.is_a?(Hash)
+ instance_variable_set("@#{key}", value)
+ end
end
end