Class: Bitmovin::Encoding::Encodings::Muxings::Drms::DrmMuxingResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb

Direct Known Subclasses

TsMuxingAesEncryption

Instance Attribute Summary collapse

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(encoding_id, muxing_id, hash = {}) ⇒ DrmMuxingResource

Returns a new instance of DrmMuxingResource.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 8

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

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



3
4
5
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 3

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 3

def description
  @description
end

#encoding_idObject

Returns the value of attribute encoding_id.



4
5
6
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 4

def encoding_id
  @encoding_id
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 5

def id
  @id
end

#modified_atObject

Returns the value of attribute modified_at.



3
4
5
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 3

def modified_at
  @modified_at
end

#muxing_idObject

Returns the value of attribute muxing_id.



4
5
6
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 4

def muxing_id
  @muxing_id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 3

def name
  @name
end

#outputsObject

Returns the value of attribute outputs.



6
7
8
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 6

def outputs
  @outputs
end

Instance Method Details

#build_output(opts = {}) ⇒ Object



21
22
23
24
25
# File 'lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb', line 21

def build_output(opts = {})
  output = Bitmovin::Encoding::StreamOutput.new(opts)
  @outputs << output
  output
end