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 = {})
  assign_attributes FinAppsCore::REST::Defaults::DEFAULTS
    .merge(options.compact)
  fail_invalid_timeout
  fail_invalid_host
  @host = @host.chomp('/')
end

Instance Attribute Details

#consumer_idObject

Returns the value of attribute consumer_id.



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

def consumer_id
  @consumer_id
end

#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_idObject

Returns the value of attribute tenant_id.



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

def tenant_id
  @tenant_id
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