Class: TranslationAPI::Config
- Inherits:
-
Object
- Object
- TranslationAPI::Config
- Includes:
- Singleton
- Defined in:
- lib/translation_api/config.rb
Instance Attribute Summary collapse
-
#custom_prompt ⇒ Object
Returns the value of attribute custom_prompt.
-
#deepl_pro ⇒ Object
Returns the value of attribute deepl_pro.
-
#except_words ⇒ Object
Returns the value of attribute except_words.
-
#language ⇒ Object
Returns the value of attribute language.
-
#output_logs ⇒ Object
Returns the value of attribute output_logs.
-
#provider ⇒ Object
Returns the value of attribute provider.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
15 16 17 18 19 20 21 22 |
# File 'lib/translation_api/config.rb', line 15 def initialize @language = "japanese" @provider = :openai @output_logs = true @except_words = [] @custom_prompt = nil @deepl_pro = false end |
Instance Attribute Details
#custom_prompt ⇒ Object
Returns the value of attribute custom_prompt.
9 10 11 |
# File 'lib/translation_api/config.rb', line 9 def custom_prompt @custom_prompt end |
#deepl_pro ⇒ Object
Returns the value of attribute deepl_pro.
9 10 11 |
# File 'lib/translation_api/config.rb', line 9 def deepl_pro @deepl_pro end |
#except_words ⇒ Object
Returns the value of attribute except_words.
9 10 11 |
# File 'lib/translation_api/config.rb', line 9 def except_words @except_words end |
#language ⇒ Object
Returns the value of attribute language.
9 10 11 |
# File 'lib/translation_api/config.rb', line 9 def language @language end |
#output_logs ⇒ Object
Returns the value of attribute output_logs.
9 10 11 |
# File 'lib/translation_api/config.rb', line 9 def output_logs @output_logs end |
#provider ⇒ Object
Returns the value of attribute provider.
9 10 11 |
# File 'lib/translation_api/config.rb', line 9 def provider @provider end |
Class Method Details
.configure(&block) ⇒ Object
11 12 13 |
# File 'lib/translation_api/config.rb', line 11 def self.configure(&block) block.call(instance) end |