Class: Streamio::Video
Constant Summary
Constants inherited from Model
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#add_transcoding(parameters) ⇒ Boolean
Adds a transcoding to the video instance and reloads itself to reflect the changed transcodings array.
-
#delete_transcoding(transcoding_id) ⇒ Boolean
Deletes a transcoding from the video and reloads itself to reflect the changed transcodings array.
Methods inherited from Model
accessable_attributes, all, count, creatable_attributes, create, #created_at, destroy, #destroy, #destroyed?, find, #initialize, #persisted?, readable_attributes, #reload, resource, resource_name, #save, #tags, #updated_at
Constructor Details
This class inherits a constructor from Streamio::Model
Instance Method Details
#add_transcoding(parameters) ⇒ Boolean
Adds a transcoding to the video instance and reloads itself to reflect the changed transcodings array.
16 17 18 19 20 |
# File 'lib/streamio/video.rb', line 16 def add_transcoding(parameters) response = self.class.resource.post("#{id}/transcodings", parameters) reload response.code.to_i == 201 end |
#delete_transcoding(transcoding_id) ⇒ Boolean
Deletes a transcoding from the video and reloads itself to reflect the changed transcodings array.
28 29 30 31 32 |
# File 'lib/streamio/video.rb', line 28 def delete_transcoding(transcoding_id) response = self.class.resource.delete("#{id}/transcodings/#{transcoding_id}") reload response.code.to_i == 200 end |