Class: AlephAlpha::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/aleph-alpha.rb

Constant Summary collapse

DEFAULT_URI_BASE =
"https://api.aleph-alpha.com".freeze
DEFAULT_REQUEST_TIMEOUT =
120

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



21
22
23
24
25
# File 'lib/aleph-alpha.rb', line 21

def initialize
  @access_token = nil
  @uri_base = DEFAULT_URI_BASE
  @request_timeout = DEFAULT_REQUEST_TIMEOUT
end

Instance Attribute Details

#access_tokenObject

Raises:



27
28
29
30
31
32
# File 'lib/aleph-alpha.rb', line 27

def access_token
  return @access_token if @access_token

  error_text = "AlephAlpha access token missing!"
  raise ConfigurationError, error_text
end

#request_timeoutObject

Returns the value of attribute request_timeout.



16
17
18
# File 'lib/aleph-alpha.rb', line 16

def request_timeout
  @request_timeout
end

#uri_baseObject

Returns the value of attribute uri_base.



16
17
18
# File 'lib/aleph-alpha.rb', line 16

def uri_base
  @uri_base
end