Class: Asimov::ApiV1::Edits

Inherits:
Base
  • Object
show all
Defined in:
lib/asimov/api_v1/edits.rb

Overview

Class interface for API methods in the “/edits” URI subspace.

Instance Method Summary collapse

Methods inherited from Base

#initialize, #rest_create_w_json_params, #rest_create_w_multipart_params, #rest_delete, #rest_get, #rest_get_streamed_download, #rest_index

Constructor Details

This class inherits a constructor from Asimov::ApiV1::Base

Instance Method Details

#create(model:, instruction:, parameters: {}) ⇒ Object

Creates an edit resource with the specified parameters.

Parameters:

  • parameters (Hash) (defaults to: {})

    the set of parameters being passed to the API

Raises:



12
13
14
15
16
17
18
19
# File 'lib/asimov/api_v1/edits.rb', line 12

def create(model:, instruction:, parameters: {})
  raise MissingRequiredParameterError.new(:model) unless model
  raise MissingRequiredParameterError.new(:instruction) unless instruction

  rest_create_w_json_params(resource: "edits",
                            parameters: parameters.merge({ model: model,
                                                           instruction: instruction }))
end