Class: M3u8::MapItem
- Inherits:
-
Object
- Object
- M3u8::MapItem
- Extended by:
- M3u8
- Includes:
- M3u8
- Defined in:
- lib/m3u8/map_item.rb
Overview
MapItem represents a EXT-X-MAP tag which specifies how to obtain the Media Initialization Section
Constant Summary
Constants included from M3u8
Instance Attribute Summary collapse
-
#byterange ⇒ Object
Returns the value of attribute byterange.
-
#uri ⇒ Object
Returns the value of attribute uri.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ MapItem
constructor
A new instance of MapItem.
- #to_s ⇒ Object
Methods included from M3u8
intialize_with_byterange, parse_attributes, parse_float, parse_yes_no, to_yes_no
Constructor Details
#initialize(params = {}) ⇒ MapItem
Returns a new instance of MapItem.
10 11 12 |
# File 'lib/m3u8/map_item.rb', line 10 def initialize(params = {}) intialize_with_byterange(params) end |
Instance Attribute Details
#byterange ⇒ Object
Returns the value of attribute byterange.
8 9 10 |
# File 'lib/m3u8/map_item.rb', line 8 def byterange @byterange end |
#uri ⇒ Object
Returns the value of attribute uri.
8 9 10 |
# File 'lib/m3u8/map_item.rb', line 8 def uri @uri end |
Class Method Details
.parse(text) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/m3u8/map_item.rb', line 14 def self.parse(text) attributes = parse_attributes text range_value = attributes['BYTERANGE'] range = ByteRange.parse(range_value) unless range_value.nil? = { uri: attributes['URI'], byterange: range } MapItem.new end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/m3u8/map_item.rb', line 22 def to_s %(#EXT-X-MAP:URI="#{uri}"#{byterange_format}) end |