Class: Experian::Configuration

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

Constant Summary collapse

DEFAULT_BASE_URI =
"https://informes.axesor.es".freeze
DEFAULT_VERSION =
"9.0".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
26
27
28
# File 'lib/experian.rb', line 21

def initialize
  @user_code = nil
  @password = nil
  @version = DEFAULT_VERSION
  @request_timeout = DEFAULT_REQUEST_TIMEOUT
  @base_uri = DEFAULT_BASE_URI
  @extra_headers = {}
end

Instance Attribute Details

#base_uriObject

Returns the value of attribute base_uri.



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

def base_uri
  @base_uri
end

#extra_headersObject

Returns the value of attribute extra_headers.



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

def extra_headers
  @extra_headers
end

#passwordObject

Raises:



35
36
37
38
# File 'lib/experian.rb', line 35

def password
  return @password if @password
  raise ConfigurationError, "Experian password missing!"
end

#request_timeoutObject

Returns the value of attribute request_timeout.



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

def request_timeout
  @request_timeout
end

#user_codeObject

Raises:



30
31
32
33
# File 'lib/experian.rb', line 30

def user_code
  return @user_code if @user_code
  raise ConfigurationError, "Experian user_code missing!"
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end