Class: Purizumu::Configuration
- Inherits:
-
Object
- Object
- Purizumu::Configuration
- Defined in:
- lib/purizumu/configuration.rb
Overview
Stores runtime configuration used by translation engines.
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#key ⇒ Object
Returns the value of attribute key.
-
#model ⇒ Object
Returns the value of attribute model.
-
#source_locale ⇒ Object
Returns the value of attribute source_locale.
-
#transport ⇒ Object
Returns the value of attribute transport.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #resolved_source_locale ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 |
# File 'lib/purizumu/configuration.rb', line 8 def initialize @engine = :xai @base_url = 'https://api.x.ai/v1' @source_locale = nil @transport = nil end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
6 7 8 |
# File 'lib/purizumu/configuration.rb', line 6 def base_url @base_url end |
#engine ⇒ Object
Returns the value of attribute engine.
6 7 8 |
# File 'lib/purizumu/configuration.rb', line 6 def engine @engine end |
#key ⇒ Object
Returns the value of attribute key.
6 7 8 |
# File 'lib/purizumu/configuration.rb', line 6 def key @key end |
#model ⇒ Object
Returns the value of attribute model.
6 7 8 |
# File 'lib/purizumu/configuration.rb', line 6 def model @model end |
#source_locale ⇒ Object
Returns the value of attribute source_locale.
6 7 8 |
# File 'lib/purizumu/configuration.rb', line 6 def source_locale @source_locale end |
#transport ⇒ Object
Returns the value of attribute transport.
6 7 8 |
# File 'lib/purizumu/configuration.rb', line 6 def transport @transport end |
Instance Method Details
#resolved_source_locale ⇒ Object
15 16 17 |
# File 'lib/purizumu/configuration.rb', line 15 def resolved_source_locale (source_locale || I18n.default_locale).to_s end |