class Bitmovin::Encoding::Encodings::InputStreams::Trimming::TimeBased
Attributes
created_at[RW]
description[RW]
duration[RW]
encoding_id[RW]
errors[RW]
input_stream_id[RW]
modified_at[RW]
name[RW]
offset[RW]
Public Class Methods
new(encoding_id, hash = {})
click to toggle source
Calls superclass method
Bitmovin::Resource::new
# File lib/bitmovin/encoding/encodings/input_streams/trimming/time_based.rb, line 8 def initialize(encoding_id, hash = {}) hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash)) @encoding_id = encoding_id init_instance(File.join("/v1/encoding/encodings/", encoding_id, "input-streams/trimming/time-based")) super(hash) @offset = hash[:offset] @duration = hash[:duration] @input_stream_id = hash[:input_stream_id] @errors = [] end
Public Instance Methods
invalid?()
click to toggle source
# File lib/bitmovin/encoding/encodings/input_streams/trimming/time_based.rb, line 26 def invalid? !valid? end
save!()
click to toggle source
Calls superclass method
Bitmovin::Resource#save!
# File lib/bitmovin/encoding/encodings/input_streams/trimming/time_based.rb, line 22 def save! super if valid? end
valid?()
click to toggle source
# File lib/bitmovin/encoding/encodings/input_streams/trimming/time_based.rb, line 30 def valid? validate! @errors.empty? end
validate!()
click to toggle source
# File lib/bitmovin/encoding/encodings/input_streams/trimming/time_based.rb, line 35 def validate! @errors = [] @errors << "Input Stream Id must be set" unless @input_stream_id @errors << "Offset must be set" unless @offset @errors << "Duration must be set" unless @duration @errors << "Duration must be greater than zero" if @duration.to_i <= 0 @errors.flatten! end