Class: Bitmovin::Encoding::Encodings::InputStreams::Ingest
- Defined in:
- lib/bitmovin/encoding/encodings/input_streams/ingest.rb
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.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#input_id ⇒ Object
Returns the value of attribute input_id.
-
#input_path ⇒ Object
Returns the value of attribute input_path.
-
#modified_at ⇒ Object
Returns the value of attribute modified_at.
-
#name ⇒ Object
Returns the value of attribute name.
-
#position ⇒ Object
Returns the value of attribute position.
-
#selection_mode ⇒ Object
Returns the value of attribute selection_mode.
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(encoding_id, hash = {}) ⇒ Ingest
constructor
A new instance of Ingest.
- #invalid? ⇒ Boolean
- #valid? ⇒ Boolean
- #validate! ⇒ Object
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 = {}) ⇒ Ingest
Returns a new instance of Ingest.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 6 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/ingest")) super(hash) @input_id = hash[:input_id] @input_path = hash[:input_path] @selection_mode = hash[:selection_mode] @position = hash[:position] @errors = [] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.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/input_streams/ingest.rb', line 3 def description @description end |
#encoding_id ⇒ Object
Returns the value of attribute encoding_id.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 3 def encoding_id @encoding_id end |
#errors ⇒ Object
Returns the value of attribute errors.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 3 def errors @errors end |
#input_id ⇒ Object
Returns the value of attribute input_id.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 3 def input_id @input_id end |
#input_path ⇒ Object
Returns the value of attribute input_path.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 3 def input_path @input_path end |
#modified_at ⇒ Object
Returns the value of attribute modified_at.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.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/input_streams/ingest.rb', line 3 def name @name end |
#position ⇒ Object
Returns the value of attribute position.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 3 def position @position end |
#selection_mode ⇒ Object
Returns the value of attribute selection_mode.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 3 def selection_mode @selection_mode end |
Instance Method Details
#invalid? ⇒ Boolean
26 27 28 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 26 def invalid? !valid? end |
#valid? ⇒ Boolean
21 22 23 24 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 21 def valid? validate! @errors.empty? end |
#validate! ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/bitmovin/encoding/encodings/input_streams/ingest.rb', line 34 def validate! @errors << "input_id cannot be blank" if @input_id.blank? @errors << "input_path cannot be blank" if @input_path.blank? @errors << "selection_mode cannot be blank" if @selection_mode.blank? if @position.blank? && @selection_mode != "AUTO" @errors << "position cannot be blank if selection_mode is not AUTO" end end |