Class: Purizumu::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/purizumu/configuration.rb

Overview

Stores runtime configuration used by translation engines.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_urlObject

Returns the value of attribute base_url.



6
7
8
# File 'lib/purizumu/configuration.rb', line 6

def base_url
  @base_url
end

#engineObject

Returns the value of attribute engine.



6
7
8
# File 'lib/purizumu/configuration.rb', line 6

def engine
  @engine
end

#keyObject

Returns the value of attribute key.



6
7
8
# File 'lib/purizumu/configuration.rb', line 6

def key
  @key
end

#modelObject

Returns the value of attribute model.



6
7
8
# File 'lib/purizumu/configuration.rb', line 6

def model
  @model
end

#source_localeObject

Returns the value of attribute source_locale.



6
7
8
# File 'lib/purizumu/configuration.rb', line 6

def source_locale
  @source_locale
end

#transportObject

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_localeObject



15
16
17
# File 'lib/purizumu/configuration.rb', line 15

def resolved_source_locale
  (source_locale || I18n.default_locale).to_s
end