Class: M3u8::SegmentItem
- Inherits:
-
Object
- Object
- M3u8::SegmentItem
- Defined in:
- lib/m3u8/segment_item.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#segment ⇒ Object
Returns the value of attribute segment.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ SegmentItem
constructor
A new instance of SegmentItem.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ SegmentItem
Returns a new instance of SegmentItem.
5 6 7 8 9 |
# File 'lib/m3u8/segment_item.rb', line 5 def initialize(params = {}) params.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
3 4 5 |
# File 'lib/m3u8/segment_item.rb', line 3 def duration @duration end |
#segment ⇒ Object
Returns the value of attribute segment.
3 4 5 |
# File 'lib/m3u8/segment_item.rb', line 3 def segment @segment end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/m3u8/segment_item.rb', line 11 def to_s "#EXTINF:#{duration},\n#{segment}" end |