Class: DeepL::Requests::Glossary::Create
- Defined in:
- lib/deepl/requests/glossary/create.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#entries_format ⇒ Object
readonly
Returns the value of attribute entries_format.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source_lang ⇒ Object
readonly
Returns the value of attribute source_lang.
-
#target_lang ⇒ Object
readonly
Returns the value of attribute target_lang.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(api, name, source_lang, target_lang, entries, options = {}) ⇒ Create
constructor
A new instance of Create.
- #request ⇒ Object
Constructor Details
#initialize(api, name, source_lang, target_lang, entries, options = {}) ⇒ Create
Returns a new instance of Create.
9 10 11 12 13 14 15 16 |
# File 'lib/deepl/requests/glossary/create.rb', line 9 def initialize(api, name, source_lang, target_lang, entries, = {}) super(api, ) @name = name @source_lang = source_lang @target_lang = target_lang @entries = entries @entries_format = delete_option(:entries_format) || 'tsv' end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
7 8 9 |
# File 'lib/deepl/requests/glossary/create.rb', line 7 def entries @entries end |
#entries_format ⇒ Object (readonly)
Returns the value of attribute entries_format.
7 8 9 |
# File 'lib/deepl/requests/glossary/create.rb', line 7 def entries_format @entries_format end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/deepl/requests/glossary/create.rb', line 7 def name @name end |
#source_lang ⇒ Object (readonly)
Returns the value of attribute source_lang.
7 8 9 |
# File 'lib/deepl/requests/glossary/create.rb', line 7 def source_lang @source_lang end |
#target_lang ⇒ Object (readonly)
Returns the value of attribute target_lang.
7 8 9 |
# File 'lib/deepl/requests/glossary/create.rb', line 7 def target_lang @target_lang end |
Instance Method Details
#request ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/deepl/requests/glossary/create.rb', line 18 def request payload = { name: name, source_lang: source_lang, target_lang: target_lang, entries: entries_to_tsv, entries_format: entries_format } build_glossary(*post(payload)) end |