Class: Zype::Subtitles
- Defined in:
- lib/zype/models/subtitles.rb
Overview
Work with subtitles for a specific video. Read more at docs.zype.com/v1.0/reference#subtitles
Constant Summary
Constants inherited from BaseModel
Instance Attribute Summary
Attributes inherited from BaseModel
Instance Method Summary collapse
-
#all(video_id:, params: {}) ⇒ Array<Hash>
Returns all subtitles for given video - add params to filter.
-
#create(video_id:, params:) ⇒ Hash
Creates a new subtitle via the API.
-
#delete(id:, video_id:) ⇒ Hash
Deletes an existing subtitle via the API.
-
#find(id:, video_id:) ⇒ Hash
Returns subtitle matching ID.
-
#update(id:, video_id:, params:) ⇒ Hash
Updates an existing subtitle via the API.
Methods inherited from BaseModel
Constructor Details
This class inherits a constructor from Zype::BaseModel
Instance Method Details
#all(video_id:, params: {}) ⇒ Array<Hash>
Returns all subtitles for given video - add params to filter
12 13 14 |
# File 'lib/zype/models/subtitles.rb', line 12 def all(video_id:, params: {}) client.execute(method: :get, path: "/videos/#{video_id}/subtitles", params: params) end |
#create(video_id:, params:) ⇒ Hash
Creates a new subtitle via the API. Files must be base64 encoded
34 35 36 |
# File 'lib/zype/models/subtitles.rb', line 34 def create(video_id:, params:) client.execute(method: :post, path: "/videos/#{video_id}/subtitles", params: params) end |
#delete(id:, video_id:) ⇒ Hash
Deletes an existing subtitle via the API
53 54 55 |
# File 'lib/zype/models/subtitles.rb', line 53 def delete(id:, video_id:) client.execute(method: :delete, path: "/videos/#{video_id}/subtitles/#{id}") end |
#find(id:, video_id:) ⇒ Hash
Returns subtitle matching ID
21 22 23 |
# File 'lib/zype/models/subtitles.rb', line 21 def find(id:, video_id:) client.execute(method: :get, path: "/videos/#{video_id}/subtitles/#{id}") end |
#update(id:, video_id:, params:) ⇒ Hash
Updates an existing subtitle via the API
44 45 46 |
# File 'lib/zype/models/subtitles.rb', line 44 def update(id:, video_id:, params:) client.execute(method: :put, path: "/videos/#{video_id}/subtitles/#{id}", params: params) end |