Class: TranslationAPI::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/translation_api/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig



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_promptObject

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_proObject

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_wordsObject

Returns the value of attribute except_words.



9
10
11
# File 'lib/translation_api/config.rb', line 9

def except_words
  @except_words
end

#languageObject

Returns the value of attribute language.



9
10
11
# File 'lib/translation_api/config.rb', line 9

def language
  @language
end

#output_logsObject

Returns the value of attribute output_logs.



9
10
11
# File 'lib/translation_api/config.rb', line 9

def output_logs
  @output_logs
end

#providerObject

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