Class: CzechPostB2bClient::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/czech_post_b2b_client/configuration.rb', line 24

def initialize
  # set defaults here

  # ours, accessible, but maybe out of date, for test usage
  @namespaces = {
    'xmlns' => 'https://b2b.postaonline.cz/schema/B2BCommon-v1',
    'xmlns:ns2' => 'https://b2b.postaonline.cz/schema/POLServices-v1',
    'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
    'xsi:noNamespaceSchemaLocation' => 'https://raw.githubusercontent.com/foton/czech_post_b2b_client/master/documents/latest_xsds/B2BCommon.xsd',
    'xsi:schemaLocation' => 'https://b2b.postaonline.cz/schema/POLServices-v1 https://raw.githubusercontent.com/foton/czech_post_b2b_client/master/documents/latest_xsds/B2BPOLServices.xsd'
  }

  @language = :cs
  @logger = defined?(Rails::Logger) ? ::Rails.logger : ::Logger.new($stdout)
  @b2b_api_base_uri = 'https://b2b.postaonline.cz/services/POLService/v1'
  @sending_post_office_location_number = 1

  # set this to :error in production for API debug logs in production.log
  @log_messages_at_least_as = :debug # so all logs keeps their level
end

Instance Attribute Details

#b2b_api_base_uriObject

Returns the value of attribute b2b_api_base_uri.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def b2b_api_base_uri
  @b2b_api_base_uri
end

#certificateObject

Returns the value of attribute certificate.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def certificate
  @certificate
end

#certificate_pathObject

Returns the value of attribute certificate_path.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def certificate_path
  @certificate_path
end

#contract_idObject

Returns the value of attribute contract_id.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def contract_id
  @contract_id
end

#custom_card_numberObject

Returns the value of attribute custom_card_number.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def custom_card_number
  @custom_card_number
end

#customer_idObject

Returns the value of attribute customer_id.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def customer_id
  @customer_id
end

#languageObject

Returns the value of attribute language.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def language
  @language
end

#log_messages_at_least_asObject

Returns the value of attribute log_messages_at_least_as.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def log_messages_at_least_as
  @log_messages_at_least_as
end

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def logger
  @logger
end

#namespacesObject

Returns the value of attribute namespaces.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def namespaces
  @namespaces
end

Returns the value of attribute print_options.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def print_options
  @print_options
end

#private_keyObject

Returns the value of attribute private_key.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def private_key
  @private_key
end

#private_key_passwordObject

Returns the value of attribute private_key_password.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def private_key_password
  @private_key_password
end

#private_key_pathObject

Returns the value of attribute private_key_path.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def private_key_path
  @private_key_path
end

#sending_post_office_codeObject

Returns the value of attribute sending_post_office_code.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def sending_post_office_code
  @sending_post_office_code
end

#sending_post_office_location_numberObject

Returns the value of attribute sending_post_office_location_number.



7
8
9
# File 'lib/czech_post_b2b_client/configuration.rb', line 7

def sending_post_office_location_number
  @sending_post_office_location_number
end