Class: Bitmovin::Encoding::Manifests::HlsVariantStreamList

Inherits:
Resource
  • Object
show all
Defined in:
lib/bitmovin/encoding/manifests/hls_variant_stream_list.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#created_at, #description, #id, #modified_at, #name

Instance Method Summary collapse

Methods inherited from Resource

#delete!, find, init, #init_instance, #inspect, list, #persisted?, #save!

Methods included from Helpers

#camelize_hash, #hash_to_struct, result, #result, #underscore_hash

Constructor Details

#initialize(manifest_id) ⇒ HlsVariantStreamList

Returns a new instance of HlsVariantStreamList.



5
6
7
8
9
# File 'lib/bitmovin/encoding/manifests/hls_variant_stream_list.rb', line 5

def initialize(manifest_id)
  @manifest_id = manifest_id
  init_instance(File.join("/v1/encoding/manifests/", manifest_id, "streams"))
  #super(hsh)
end

Instance Attribute Details

#manifest_idObject

Returns the value of attribute manifest_id.



3
4
5
# File 'lib/bitmovin/encoding/manifests/hls_variant_stream_list.rb', line 3

def manifest_id
  @manifest_id
end

Instance Method Details

#build(hash = {}) ⇒ Object



17
18
19
# File 'lib/bitmovin/encoding/manifests/hls_variant_stream_list.rb', line 17

def build(hash = {})
  HlsVariantStream.new(@manifest_id, hash)
end

#list(limit = 100, offset = 0) ⇒ Object



11
12
13
14
15
# File 'lib/bitmovin/encoding/manifests/hls_variant_stream_list.rb', line 11

def list(limit = 100, offset = 0)
  path = File.join("/v1/encoding/manifests/hls", @manifest_id, self.class.resource_path)
  response = Bitmovin.client.get(path, { limit: limit, offset: offset })
  result(response)['items'].map { |item| self.class.klass.new(@manifest_id, item) }
end