class Transloadit::Template
Represents a Template
API ready to interact with its corresponding REST API.
See the Transloadit
documentation for futher information on Templates and their parameters.
Public Instance Methods
Submits a template to be created.
@param [Hash] params POST data to submit with the request.
must contain keys 'name' and 'template'
@option params [String] :name name assigned to the newly created template @option params [Hash] :template key, value pair of template content
see {template}[https://transloadit.com/templates]
# File lib/transloadit/template.rb, line 20 def create(params) _do_request('/templates', params, 'post') end
Deletes the template object specified by the template id @param [String] id id of the desired template @param [Hash] additional POST data to submit with the request
# File lib/transloadit/template.rb, line 60 def delete(id, params = {}) _do_request("/templates/#{id}", params, 'delete') end
Returns a single template object specified by the template id @param [String] id id of the desired template @param [Hash] additional GET data to submit with the request
# File lib/transloadit/template.rb, line 37 def get(id, params = {}) _do_request("/templates/#{id}", params) end
Returns a list of all templates @param [Hash] additional GET data to submit with the request
# File lib/transloadit/template.rb, line 28 def list(params = {}) _do_request('/templates', params) end
Updates the template object specified by the template id @param [String] id id of the desired template @param [Hash] additional POST data to submit with the request
must contain keys 'name' and 'template'
@option params [String] :name name assigned to the newly created template @option params [Hash] :template key, value pair of template content
see {template}[https://transloadit.com/templates]
# File lib/transloadit/template.rb, line 51 def update(id, params = {}) _do_request("/templates/#{id}", params, 'put') end