Class: DeepL::GlossaryApi

Inherits:
Object
  • Object
show all
Defined in:
lib/deepl/glossary_api.rb

Instance Method Summary collapse

Constructor Details

#initialize(api, options = {}) ⇒ GlossaryApi

Returns a new instance of GlossaryApi.



8
9
10
11
# File 'lib/deepl/glossary_api.rb', line 8

def initialize(api, options = {})
  @api = api
  @options = options
end

Instance Method Details

#create(name, source_lang, target_lang, entries, options = {}) ⇒ Object



13
14
15
16
# File 'lib/deepl/glossary_api.rb', line 13

def create(name, source_lang, target_lang, entries, options = {})
  DeepL::Requests::Glossary::Create.new(@api, name, source_lang, target_lang, entries, options)
                                   .request
end

#destroy(glossary_id, options = {}) ⇒ Object



18
19
20
# File 'lib/deepl/glossary_api.rb', line 18

def destroy(glossary_id, options = {})
  DeepL::Requests::Glossary::Destroy.new(@api, glossary_id, options).request
end

#entries(glossary_id, options = {}) ⇒ Object



22
23
24
# File 'lib/deepl/glossary_api.rb', line 22

def entries(glossary_id, options = {})
  DeepL::Requests::Glossary::Entries.new(@api, glossary_id, options).request
end

#find(glossary_id, options = {}) ⇒ Object



26
27
28
# File 'lib/deepl/glossary_api.rb', line 26

def find(glossary_id, options = {})
  DeepL::Requests::Glossary::Find.new(@api, glossary_id, options).request
end

#language_pairs(options = {}) ⇒ Object



30
31
32
# File 'lib/deepl/glossary_api.rb', line 30

def language_pairs(options = {})
  DeepL::Requests::Glossary::LanguagePairs.new(@api, options).request
end

#list(options = {}) ⇒ Object



34
35
36
# File 'lib/deepl/glossary_api.rb', line 34

def list(options = {})
  DeepL::Requests::Glossary::List.new(@api, options).request
end