Class: TestPack1::Configuration

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

Overview

All configuration including auth info and base URI for the API access are configured in this class.

Defined Under Namespace

Classes: Environment, Server

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_tokenObject

Returns the value of attribute api_token.



60
61
62
# File 'lib/test_pack_1/configuration.rb', line 60

def api_token
  @api_token
end

.array_serializationObject

Returns the value of attribute array_serialization.



56
57
58
# File 'lib/test_pack_1/configuration.rb', line 56

def array_serialization
  @array_serialization
end

.customerObject

Returns the value of attribute customer.



59
60
61
# File 'lib/test_pack_1/configuration.rb', line 59

def customer
  @customer
end

.environmentObject

Returns the value of attribute environment.



57
58
59
# File 'lib/test_pack_1/configuration.rb', line 57

def environment
  @environment
end

.environmentsObject

Returns the value of attribute environments.



58
59
60
# File 'lib/test_pack_1/configuration.rb', line 58

def environments
  @environments
end

Class Method Details

.get_base_uri(server = Server::DEFAULT) ⇒ String

Generates the appropriate base URI for the environment and the server. required.

Parameters:

Returns:



45
46
47
48
49
50
51
52
# File 'lib/test_pack_1/configuration.rb', line 45

def self.get_base_uri(server = Server::DEFAULT)
  parameters = {
    'customer' => customer
  }
  APIHelper.append_url_with_template_parameters(
    environments[environment][server], parameters
  )
end