Class: Bitmovin::Encoding::Manifests::ManifestResource

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

Instance Attribute Summary

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(hash = {}) ⇒ ManifestResource

Returns a new instance of ManifestResource.



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/bitmovin/encoding/manifests/manifest_resource.rb', line 3

def initialize(hash = {})
  hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
  muxing_type = self.class.name.demodulize.gsub(/(.*)Muxing/, '\1').downcase
  init_instance(File.join("/v1/encoding/manifests/", encoding_id, "muxings", muxing_type))
  super(hsh)
  @outputs = (hsh[:outputs] || []).map do |output|
    Bitmovin::Encoding::Encodings::StreamOutput.new(encoding_id, @id, output)
  end
  @streams = (hsh[:streams] || []).map do |stream|
    stream[:stream_id]
  end
end