Class: PurolatorRuby::EnvironmentCredentials

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEnvironmentCredentials

Returns a new instance of EnvironmentCredentials.



10
11
12
13
14
15
16
17
# File 'lib/purolator_ruby/environment_credentials.rb', line 10

def initialize
  @wsdl_location = ENV.fetch('PLUROLATOR_RUBY_WSDL_LOCATION')
  @developer_key = ENV.fetch('PLUROLATOR_RUBY_DEVELOPER_KEY')
  @developer_password = ENV.fetch('PLUROLATOR_RUBY_DEVELOPER_PASSWORD')
  @client_id = ENV.fetch('PLUROLATOR_RUBY_CLIENT_ID')
  @account_number = ENV.fetch('PLUROLATOR_RUBY_ACCOUNT_NUMBER')
  @billing_number = ENV.fetch('PLUROLATOR_RUBY_BILLING_NUMBER')
end

Instance Attribute Details

#account_numberObject (readonly)

Returns the value of attribute account_number.



3
4
5
# File 'lib/purolator_ruby/environment_credentials.rb', line 3

def 
  @account_number
end

#billing_numberObject (readonly)

Returns the value of attribute billing_number.



3
4
5
# File 'lib/purolator_ruby/environment_credentials.rb', line 3

def billing_number
  @billing_number
end

#client_idObject (readonly)

Returns the value of attribute client_id.



3
4
5
# File 'lib/purolator_ruby/environment_credentials.rb', line 3

def client_id
  @client_id
end

#developer_keyObject (readonly)

Returns the value of attribute developer_key.



3
4
5
# File 'lib/purolator_ruby/environment_credentials.rb', line 3

def developer_key
  @developer_key
end

#developer_passwordObject (readonly)

Returns the value of attribute developer_password.



3
4
5
# File 'lib/purolator_ruby/environment_credentials.rb', line 3

def developer_password
  @developer_password
end

#wsdl_locationObject (readonly)

Returns the value of attribute wsdl_location.



3
4
5
# File 'lib/purolator_ruby/environment_credentials.rb', line 3

def wsdl_location
  @wsdl_location
end

Instance Method Details

#basic_authObject



19
20
21
# File 'lib/purolator_ruby/environment_credentials.rb', line 19

def basic_auth
  [@developer_key, @developer_password]
end

#soap_headerObject



23
24
25
# File 'lib/purolator_ruby/environment_credentials.rb', line 23

def soap_header
  soap_header_v15
end