Class: Bitmovin::Encoding::Encodings::Muxings::MuxingResource
- Defined in:
- lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#encoding_id ⇒ Object
Returns the value of attribute encoding_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#modified_at ⇒ Object
Returns the value of attribute modified_at.
-
#name ⇒ Object
Returns the value of attribute name.
-
#outputs ⇒ Object
Returns the value of attribute outputs.
-
#streams ⇒ Object
Returns the value of attribute streams.
Instance Method Summary collapse
- #build_output(opts = {}) ⇒ Object
-
#initialize(encoding_id, hash = {}) ⇒ MuxingResource
constructor
A new instance of MuxingResource.
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, hash = {}) ⇒ MuxingResource
Returns a new instance of MuxingResource.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 7 def initialize(encoding_id, hash = {}) hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash)) @encoding_id = encoding_id muxing_type = self.class.name.demodulize.gsub(/(.*)Muxing/, '\1').downcase init_instance(File.join("/v1/encoding/encodings/", encoding_id, "muxings", muxing_type)) super(hsh) @outputs = (hsh[:outputs] || []).map do |output| Bitmovin::Encoding::StreamOutput.new(output) end @streams = (hsh[:streams] || []).map do |stream| stream[:stream_id] end end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 3 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 3 def description @description end |
#encoding_id ⇒ Object
Returns the value of attribute encoding_id.
4 5 6 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 4 def encoding_id @encoding_id end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 5 def id @id end |
#modified_at ⇒ Object
Returns the value of attribute modified_at.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 3 def modified_at @modified_at end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 3 def name @name end |
#outputs ⇒ Object
Returns the value of attribute outputs.
21 22 23 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 21 def outputs @outputs end |
#streams ⇒ Object
Returns the value of attribute streams.
21 22 23 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 21 def streams @streams end |
Instance Method Details
#build_output(opts = {}) ⇒ Object
23 24 25 26 27 |
# File 'lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb', line 23 def build_output(opts = {}) output = Bitmovin::Encoding::StreamOutput.new(opts) @outputs << output output end |