Sha256: a7feb4cee798ee6a2bd6400967ab86a8d203dbbcf7738b7566b58e6be85ef217

Contents?: true

Size: 487 Bytes

Versions: 9

Compression:

Stored size: 487 Bytes

Contents

module M3u8
  # KeyItem represents a set of EXT-X-KEY attributes
  class KeyItem
    include Encryptable
    extend M3u8

    def initialize(params = {})
      options = convert_key_names(params)
      options.merge(params).each do |key, value|
        instance_variable_set("@#{key}", value)
      end
    end

    def self.parse(text)
      attributes = parse_attributes(text)
      KeyItem.new(attributes)
    end

    def to_s
      "#EXT-X-KEY:#{attributes_to_s}"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
m3u8-0.7.0 lib/m3u8/key_item.rb
m3u8-0.6.9 lib/m3u8/key_item.rb
m3u8-0.6.8 lib/m3u8/key_item.rb
m3u8-0.6.7 lib/m3u8/key_item.rb
m3u8-0.6.6 lib/m3u8/key_item.rb
m3u8-0.6.5 lib/m3u8/key_item.rb
m3u8-0.6.4 lib/m3u8/key_item.rb
m3u8-0.6.3 lib/m3u8/key_item.rb
m3u8-0.6.2 lib/m3u8/key_item.rb