Sha256: 77da342499f7f663d8e8c87a5942a48722e8ba3e505518b2dbeae0d6ba2f8a79
Contents?: true
Size: 1.74 KB
Versions: 3
Compression:
Stored size: 1.74 KB
Contents
module Zype module Base # Any videos nested routes will inherit from this class class Videos < Zype::BaseModel # Returns all objects for given class # # @param video_id [String] the ID of the video # @return [Array<Hash>] the objects returned from the API def all(video_id:) client.execute(method: :get, path: "/videos/#{video_id}/#{path}") end # Returns object matching ID # # @param video_id [String] the ID of the video # @param id [String] the ID of the object # @return [Hash] the object returned from the API def find(video_id:, id:) client.execute(method: :get, path: "/videos/#{video_id}/#{path}/#{id}") end # Creates a new object via the API. # # @param video_id [String] ID of the video to assign to the object # @param params [Hash] the properties of the object # @return [Hash] the newly created object def create(video_id:, params:) client.execute(method: :post, path: "/videos/#{video_id}/#{path}", params: params) end # Updates an existing object via the API # # @param id [String] the ID of the object # @param params [Hash] the properties to be updated # @return [Hash] the updated object def update(video_id:, id:, params:) client.execute(method: :put, path: "/videos/#{video_id}/#{path}/#{id}", params: params) end # Deletes an existing object via the API # # @param video_id [String] the ID of the video # @param id [String] the ID of the object # @return [Hash] the deleted object def delete(video_id:, id:) client.execute(method: :delete, path: "/videos/#{video_id}/#{path}/#{id}") end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
zype-0.13.0 | lib/zype/models/base/videos.rb |
zype-0.12.0 | lib/zype/models/base/videos.rb |
zype-0.11.0 | lib/zype/models/base/videos.rb |