Class: DeepL::StyleRuleApi
- Inherits:
-
Object
- Object
- DeepL::StyleRuleApi
- Defined in:
- lib/deepl/style_rule_api.rb
Instance Method Summary collapse
- #create(name, language, options = {}) ⇒ Object
- #create_custom_instruction(style_id, label, prompt, source_language = nil, options = {}) ⇒ Object
- #destroy(style_id, options = {}) ⇒ Object
- #destroy_custom_instruction(style_id, instruction_id, options = {}) ⇒ Object
- #find(style_id, options = {}) ⇒ Object
- #find_custom_instruction(style_id, instruction_id, options = {}) ⇒ Object
-
#initialize(api, options = {}) ⇒ StyleRuleApi
constructor
A new instance of StyleRuleApi.
- #list(options = {}) ⇒ Object
- #update_configured_rules(style_id, configured_rules, options = {}) ⇒ Object
- #update_custom_instruction(style_id, instruction_id, label, prompt, source_language = nil, options = {}) ⇒ Object
- #update_name(style_id, name, options = {}) ⇒ Object
Constructor Details
#initialize(api, options = {}) ⇒ StyleRuleApi
Returns a new instance of StyleRuleApi.
8 9 10 11 |
# File 'lib/deepl/style_rule_api.rb', line 8 def initialize(api, = {}) @api = api @options = end |
Instance Method Details
#create(name, language, options = {}) ⇒ Object
17 18 19 |
# File 'lib/deepl/style_rule_api.rb', line 17 def create(name, language, = {}) DeepL::Requests::StyleRule::Create.new(@api, name, language, ).request end |
#create_custom_instruction(style_id, label, prompt, source_language = nil, options = {}) ⇒ Object
38 39 40 41 |
# File 'lib/deepl/style_rule_api.rb', line 38 def create_custom_instruction(style_id, label, prompt, source_language = nil, = {}) DeepL::Requests::StyleRule::CreateCustomInstruction.new(@api, style_id, label, prompt, source_language, ).request end |
#destroy(style_id, options = {}) ⇒ Object
29 30 31 |
# File 'lib/deepl/style_rule_api.rb', line 29 def destroy(style_id, = {}) DeepL::Requests::StyleRule::Destroy.new(@api, style_id, ).request end |
#destroy_custom_instruction(style_id, instruction_id, options = {}) ⇒ Object
56 57 58 59 |
# File 'lib/deepl/style_rule_api.rb', line 56 def destroy_custom_instruction(style_id, instruction_id, = {}) DeepL::Requests::StyleRule::DestroyCustomInstruction.new(@api, style_id, instruction_id, ).request end |
#find(style_id, options = {}) ⇒ Object
21 22 23 |
# File 'lib/deepl/style_rule_api.rb', line 21 def find(style_id, = {}) DeepL::Requests::StyleRule::Find.new(@api, style_id, ).request end |
#find_custom_instruction(style_id, instruction_id, options = {}) ⇒ Object
43 44 45 46 |
# File 'lib/deepl/style_rule_api.rb', line 43 def find_custom_instruction(style_id, instruction_id, = {}) DeepL::Requests::StyleRule::FindCustomInstruction.new(@api, style_id, instruction_id, ).request end |
#list(options = {}) ⇒ Object
13 14 15 |
# File 'lib/deepl/style_rule_api.rb', line 13 def list( = {}) DeepL::Requests::StyleRule::List.new(@api, ).request end |
#update_configured_rules(style_id, configured_rules, options = {}) ⇒ Object
33 34 35 36 |
# File 'lib/deepl/style_rule_api.rb', line 33 def update_configured_rules(style_id, configured_rules, = {}) DeepL::Requests::StyleRule::UpdateConfiguredRules.new(@api, style_id, configured_rules, ).request end |
#update_custom_instruction(style_id, instruction_id, label, prompt, source_language = nil, options = {}) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/deepl/style_rule_api.rb', line 48 def update_custom_instruction(style_id, instruction_id, label, prompt, source_language = nil, = {}) DeepL::Requests::StyleRule::UpdateCustomInstruction.new(@api, style_id, instruction_id, label, prompt, source_language, ).request end |