Class: M3u8::KeyItem
- Inherits:
-
Object
- Object
- M3u8::KeyItem
- Extended by:
- M3u8
- Includes:
- Encryptable
- Defined in:
- lib/m3u8/key_item.rb
Overview
KeyItem represents a set of EXT-X-KEY attributes
Constant Summary
Constants included from M3u8
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ KeyItem
constructor
A new instance of KeyItem.
- #to_s ⇒ Object
Methods included from M3u8
intialize_with_byterange, parse_attributes, parse_float, parse_yes_no, to_yes_no
Methods included from Encryptable
#attributes_to_s, #convert_key_names, included
Constructor Details
#initialize(params = {}) ⇒ KeyItem
Returns a new instance of KeyItem.
8 9 10 11 12 13 |
# File 'lib/m3u8/key_item.rb', line 8 def initialize(params = {}) = convert_key_names(params) .merge(params).each do |key, value| instance_variable_set("@#{key}", value) end end |
Class Method Details
.parse(text) ⇒ Object
15 16 17 18 |
# File 'lib/m3u8/key_item.rb', line 15 def self.parse(text) attributes = parse_attributes(text) KeyItem.new(attributes) end |
Instance Method Details
#to_s ⇒ Object
20 21 22 |
# File 'lib/m3u8/key_item.rb', line 20 def to_s "#EXT-X-KEY:#{attributes_to_s}" end |