Class: Bitmovin::Encoding::Manifests::DashManifest
- Includes:
- ChildCollection
- Defined in:
- lib/bitmovin/encoding/manifests/dash_manifest.rb
Instance Attribute Summary collapse
-
#manifest_name ⇒ Object
Returns the value of attribute manifest_name.
-
#outputs ⇒ Object
Returns the value of attribute outputs.
Attributes inherited from Resource
#created_at, #description, #id, #modified_at, #name
Instance Method Summary collapse
- #full_status ⇒ Object
-
#initialize(hash = {}) ⇒ DashManifest
constructor
A new instance of DashManifest.
- #persisted? ⇒ Boolean
- #progress ⇒ Object
- #reload! ⇒ Object
- #start! ⇒ Object
- #status ⇒ Object
Methods included from ChildCollection
Methods inherited from Resource
#delete!, find, init, #init_instance, #inspect, list, #save!
Methods included from Helpers
#camelize_hash, #hash_to_struct, result, #result, #underscore_hash
Constructor Details
#initialize(hash = {}) ⇒ DashManifest
Returns a new instance of DashManifest.
6 7 8 9 10 11 |
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 6 def initialize(hash = {}) hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash)) super(hash) @outputs = (hsh[:outputs] || []).map { |output| Bitmovin::Encoding::StreamOutput.new(output) } @periods = nil end |
Instance Attribute Details
#manifest_name ⇒ Object
Returns the value of attribute manifest_name.
15 16 17 |
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 15 def manifest_name @manifest_name end |
#outputs ⇒ Object
Returns the value of attribute outputs.
15 16 17 |
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 15 def outputs @outputs end |
Instance Method Details
#full_status ⇒ Object
30 31 32 33 34 |
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 30 def full_status path = File.join("/v1/encoding/manifests/dash/", @id, "status") response = Bitmovin.client.get(path) hash_to_struct(result(response)) end |
#persisted? ⇒ Boolean
17 18 19 |
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 17 def persisted? !@id.nil? end |
#progress ⇒ Object
40 41 42 |
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 40 def progress full_status.progress end |
#reload! ⇒ Object
21 22 23 |
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 21 def reload! @periods = nil end |
#start! ⇒ Object
25 26 27 28 |
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 25 def start! path = File.join("/v1/encoding/manifests/dash/", @id, "start") Bitmovin.client.post(path) end |
#status ⇒ Object
36 37 38 |
# File 'lib/bitmovin/encoding/manifests/dash_manifest.rb', line 36 def status full_status.status end |