Class: M3u8::SegmentItem
- Inherits:
-
Object
- Object
- M3u8::SegmentItem
- Includes:
- M3u8
- Defined in:
- lib/m3u8/segment_item.rb
Overview
SegmentItem represents EXTINF attributes with the URI that follows, optionally allowing an EXT-X-BYTERANGE tag to be set.
Constant Summary
Constants included from M3u8
Instance Attribute Summary collapse
-
#byterange ⇒ Object
Returns the value of attribute byterange.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#program_date_time ⇒ Object
Returns the value of attribute program_date_time.
-
#segment ⇒ Object
Returns the value of attribute segment.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ SegmentItem
constructor
A new instance of SegmentItem.
- #to_s ⇒ Object
Methods included from M3u8
#intialize_with_byterange, #parse_attributes, #parse_yes_no
Constructor Details
#initialize(params = {}) ⇒ SegmentItem
Returns a new instance of SegmentItem.
8 9 10 |
# File 'lib/m3u8/segment_item.rb', line 8 def initialize(params = {}) intialize_with_byterange(params) end |
Instance Attribute Details
#byterange ⇒ Object
Returns the value of attribute byterange.
6 7 8 |
# File 'lib/m3u8/segment_item.rb', line 6 def byterange @byterange end |
#comment ⇒ Object
Returns the value of attribute comment.
6 7 8 |
# File 'lib/m3u8/segment_item.rb', line 6 def comment @comment end |
#duration ⇒ Object
Returns the value of attribute duration.
6 7 8 |
# File 'lib/m3u8/segment_item.rb', line 6 def duration @duration end |
#program_date_time ⇒ Object
Returns the value of attribute program_date_time.
6 7 8 |
# File 'lib/m3u8/segment_item.rb', line 6 def program_date_time @program_date_time end |
#segment ⇒ Object
Returns the value of attribute segment.
6 7 8 |
# File 'lib/m3u8/segment_item.rb', line 6 def segment @segment end |
Instance Method Details
#to_s ⇒ Object
12 13 14 15 |
# File 'lib/m3u8/segment_item.rb', line 12 def to_s date = "#{program_date_time}\n" unless program_date_time.nil? "#EXTINF:#{duration},#{comment}#{byterange_format}\n#{date}#{segment}" end |