lib/bitmovin/encoding/encodings/stream.rb in bitmovin-ruby-0.5.0 vs lib/bitmovin/encoding/encodings/stream.rb in bitmovin-ruby-0.7.0

- old
+ new

@@ -1,22 +1,24 @@ module Bitmovin::Encoding::Encodings class Stream < Bitmovin::Resource attr_accessor :encoding_id attr_accessor :id attr_accessor :conditions + attr_accessor :mode def initialize(encoding_id, hash = {}) set_defaults hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash)) @encoding_id = encoding_id - self.class.init(File.join("/v1/encoding/encodings/", encoding_id, "streams")) + init_instance(File.join("/v1/encoding/encodings/", encoding_id, "streams")) super(hash) @outputs = (hsh[:outputs] || []).map { |output| Bitmovin::Encoding::StreamOutput.new(output) } @input_streams = (hsh[:input_streams] || []).map { |input| StreamInput.new(@encoding_id, @id, input) } @errors = [] @conditions = nil + @mode = "STANDARD" end attr_accessor :name, :description, :created_at, :modified_at, :create_quality_meta_data def input_streams @@ -83,10 +85,10 @@ private def collect_attributes val = Hash.new [:name, :description, :create_quality_meta_data, - :input_streams, :outputs, :codec_config_id, :conditions].each do |name| + :input_streams, :outputs, :codec_config_id, :conditions, :mode].each do |name| json_name = ActiveSupport::Inflector.camelize(name.to_s, false) val[json_name] = instance_variable_get("@#{name}") end if @conditions.nil? val.delete("conditions")