Class: DetectLanguage::Configuration
- Inherits:
-
Object
- Object
- DetectLanguage::Configuration
- Defined in:
- lib/detect_language/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
The API key for your project, found on your homepage after you log in into detectlanguage.com website.
-
#base_url ⇒ Object
API base URL.
-
#http_open_timeout ⇒ Object
The HTTP open timeout in seconds.
-
#http_read_timeout ⇒ Object
The HTTP read timeout in seconds.
-
#proxy ⇒ Object
The HTTP proxy to use for requests.
-
#user_agent ⇒ Object
HTTP request user agent (defaults to ‘Detect Language API ruby gem’).
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 |
# File 'lib/detect_language/configuration.rb', line 22 def initialize @api_key = nil @base_url = "https://ws.detectlanguage.com/v3/" @user_agent = "detectlanguage-ruby/#{VERSION}" end |
Instance Attribute Details
#api_key ⇒ Object
The API key for your project, found on your homepage after you log in into detectlanguage.com website
5 6 7 |
# File 'lib/detect_language/configuration.rb', line 5 def api_key @api_key end |
#base_url ⇒ Object
API base URL
8 9 10 |
# File 'lib/detect_language/configuration.rb', line 8 def base_url @base_url end |
#http_open_timeout ⇒ Object
The HTTP open timeout in seconds.
14 15 16 |
# File 'lib/detect_language/configuration.rb', line 14 def http_open_timeout @http_open_timeout end |
#http_read_timeout ⇒ Object
The HTTP read timeout in seconds.
17 18 19 |
# File 'lib/detect_language/configuration.rb', line 17 def http_read_timeout @http_read_timeout end |
#proxy ⇒ Object
The HTTP proxy to use for requests. Example: ‘my-proxy:8080’
20 21 22 |
# File 'lib/detect_language/configuration.rb', line 20 def proxy @proxy end |
#user_agent ⇒ Object
HTTP request user agent (defaults to ‘Detect Language API ruby gem’).
11 12 13 |
# File 'lib/detect_language/configuration.rb', line 11 def user_agent @user_agent end |