Class: Bitmovin::Encoding::Encodings::List
- Inherits:
-
Object
- Object
- Bitmovin::Encoding::Encodings::List
- Includes:
- Helpers
- Defined in:
- lib/bitmovin/encoding/encodings/list.rb
Direct Known Subclasses
Muxings::Drms::TsMuxingAesEncryptionList, Muxings::Fmp4MuxingList, Muxings::Mp4MuxingList, Muxings::TsMuxingList, Muxings::WebmMuxingList, StreamList
Class Attribute Summary collapse
-
.klass ⇒ Object
readonly
Returns the value of attribute klass.
-
.resource_path ⇒ Object
readonly
Returns the value of attribute resource_path.
Instance Attribute Summary collapse
-
#encoding_id ⇒ Object
Returns the value of attribute encoding_id.
Class Method Summary collapse
Instance Method Summary collapse
- #add(stream) ⇒ Object
- #build(hash = {}) ⇒ Object
- #find(id) ⇒ Object
-
#initialize(encoding_id) ⇒ List
constructor
A new instance of List.
- #list(limit = 100, offset = 0) ⇒ Object
Methods included from Helpers
#camelize_hash, #hash_to_struct, result, #result, #underscore_hash
Constructor Details
#initialize(encoding_id) ⇒ List
Returns a new instance of List.
15 16 17 |
# File 'lib/bitmovin/encoding/encodings/list.rb', line 15 def initialize(encoding_id) @encoding_id = encoding_id end |
Class Attribute Details
.klass ⇒ Object (readonly)
Returns the value of attribute klass.
11 12 13 |
# File 'lib/bitmovin/encoding/encodings/list.rb', line 11 def klass @klass end |
.resource_path ⇒ Object (readonly)
Returns the value of attribute resource_path.
10 11 12 |
# File 'lib/bitmovin/encoding/encodings/list.rb', line 10 def resource_path @resource_path end |
Instance Attribute Details
#encoding_id ⇒ Object
Returns the value of attribute encoding_id.
14 15 16 |
# File 'lib/bitmovin/encoding/encodings/list.rb', line 14 def encoding_id @encoding_id end |
Class Method Details
.init(path, klass) ⇒ Object
6 7 8 9 |
# File 'lib/bitmovin/encoding/encodings/list.rb', line 6 def init(path, klass) @resource_path = path @klass = klass end |
Instance Method Details
#add(stream) ⇒ Object
25 26 27 |
# File 'lib/bitmovin/encoding/encodings/list.rb', line 25 def add(stream) raise "Not implemented yet. Please use #build and Stream#save! for the time being" end |
#build(hash = {}) ⇒ Object
29 30 31 |
# File 'lib/bitmovin/encoding/encodings/list.rb', line 29 def build(hash = {}) self.class.klass.new(@encoding_id, hash) end |
#find(id) ⇒ Object
33 34 35 36 37 |
# File 'lib/bitmovin/encoding/encodings/list.rb', line 33 def find(id) path = File.join("/v1/encoding/encodings/", @encoding_id, self.class.resource_path, id) response = Bitmovin.client.get(path) self.class.klass.new(@encoding_id, result(response)) end |
#list(limit = 100, offset = 0) ⇒ Object
19 20 21 22 23 |
# File 'lib/bitmovin/encoding/encodings/list.rb', line 19 def list(limit = 100, offset = 0) path = File.join("/v1/encoding/encodings/", @encoding_id, self.class.resource_path) response = Bitmovin.client.get(path, { limit: limit, offset: offset }) result(response)['items'].map { |item| self.class.klass.new(@encoding_id, item) } end |