class FormatParser::M3UParser
Constants
- HEADER
- M3U8_MIME_TYPE
Public Instance Methods
call(io)
click to toggle source
# File lib/parsers/m3u_parser.rb, line 11 def call(io) io = FormatParser::IOConstraint.new(io) header = safe_read(io, 7) return unless HEADER.eql?(header) FormatParser::Text.new( format: :m3u, content_type: M3U8_MIME_TYPE, ) end
likely_match?(filename)
click to toggle source
# File lib/parsers/m3u_parser.rb, line 7 def likely_match?(filename) filename =~ /\.m3u8?$/i end