Class: DeepL::Requests::StyleRule::UpdateCustomInstruction
- Inherits:
-
Base
- Object
- Base
- DeepL::Requests::StyleRule::UpdateCustomInstruction
show all
- Defined in:
- lib/deepl/requests/style_rule/update_custom_instruction.rb
Instance Attribute Summary
Attributes inherited from Base
#api, #options, #response
Instance Method Summary
collapse
Methods inherited from Base
#details
Constructor Details
#initialize(api, style_id, instruction_id, label, prompt, source_language = nil, options = {}) ⇒ UpdateCustomInstruction
rubocop:disable Metrics/ParameterLists
10
11
12
13
14
15
16
17
18
|
# File 'lib/deepl/requests/style_rule/update_custom_instruction.rb', line 10
def initialize(api, style_id, instruction_id, label, prompt, source_language = nil, options = {})
super(api, options)
@style_id = style_id
@instruction_id = instruction_id
@label = label
@prompt = prompt
@source_language = source_language
end
|
Instance Method Details
#request ⇒ Object
20
21
22
23
24
|
# File 'lib/deepl/requests/style_rule/update_custom_instruction.rb', line 20
def request
payload = { label: @label, prompt: @prompt }
payload[:source_language] = @source_language if @source_language
build_custom_instruction(*execute_request_with_retries(put_request(payload)))
end
|
#to_s ⇒ Object
26
27
28
|
# File 'lib/deepl/requests/style_rule/update_custom_instruction.rb', line 26
def to_s
"PUT #{uri.request_uri}"
end
|