Sha256: 84a49be258778a834c52542c06559e1d3e3ef3dd62ad38b33a55399a83a5377c

Contents?: true

Size: 547 Bytes

Versions: 4

Compression:

Stored size: 547 Bytes

Contents

# frozen_string_literal: true
module M3u8
  # KeyItem represents a set of EXT-X-SESSION-KEY attributes
  class SessionKeyItem
    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)
      SessionKeyItem.new(attributes)
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
m3u8-0.8.2 lib/m3u8/session_key_item.rb
m3u8-0.8.1 lib/m3u8/session_key_item.rb
m3u8-0.8.0 lib/m3u8/session_key_item.rb
m3u8-0.7.1 lib/m3u8/session_key_item.rb