Class: FinAppsCore::REST::Configuration

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

Overview

Represents the client configuration options

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configuration

Returns a new instance of Configuration.



13
14
15
16
17
18
19
# File 'lib/finapps_core/rest/configuration.rb', line 13

def initialize(options = {})
  FinAppsCore::REST::Defaults::DEFAULTS.merge(remove_empty_options(options))
                                       .each {|key, value| public_send("#{key}=", value) }

  raise FinAppsCore::InvalidArgumentsError, "Invalid argument. {host: #{host}}" unless valid_host?
  raise FinAppsCore::InvalidArgumentsError, "Invalid argument. {timeout: #{timeout}}" unless timeout.integer?
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def host
  @host
end

#log_levelObject

Returns the value of attribute log_level.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def log_level
  @log_level
end

#proxyObject

Returns the value of attribute proxy.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def proxy
  @proxy
end

#rashifyObject

Returns the value of attribute rashify.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def rashify
  @rashify
end

#request_idObject

Returns the value of attribute request_id.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def request_id
  @request_id
end

#retry_limitObject

Returns the value of attribute retry_limit.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def retry_limit
  @retry_limit
end

#tenant_tokenObject

Returns the value of attribute tenant_token.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def tenant_token
  @tenant_token
end

#timeoutObject

Returns the value of attribute timeout.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def timeout
  @timeout
end

#user_identifierObject

Returns the value of attribute user_identifier.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def user_identifier
  @user_identifier
end

#user_tokenObject

Returns the value of attribute user_token.



9
10
11
# File 'lib/finapps_core/rest/configuration.rb', line 9

def user_token
  @user_token
end

Instance Method Details

#valid_user_credentials?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/finapps_core/rest/configuration.rb', line 21

def valid_user_credentials?
  FinAppsCore::REST::Credentials.new(user_identifier, user_token).valid?
end