Class: Contrast::Config::CertificationConfiguration
- Defined in:
- lib/contrast/config/certification_configuration.rb
Overview
Certificate Configuration
Constant Summary collapse
- CANON_NAME =
'api.certification'
- CONFIG_VALUES =
%w[ca_file cert_file key_file enable].cs__freeze
Constants included from Contrast::Components::ComponentBase
Contrast::Components::ComponentBase::ENABLE
Constants included from Diagnostics::Tools
Constants included from Diagnostics::SingletonTools
Diagnostics::SingletonTools::API_CREDENTIALS, Diagnostics::SingletonTools::CONTRAST_MARK
Constants included from BaseConfiguration
BaseConfiguration::AT_UNDERSCORE
Instance Attribute Summary collapse
-
#ca_file ⇒ String
Path to CA Cert file.
-
#cert_file ⇒ String
Path to Certification file.
- #enable ⇒ Boolean, false
-
#key_file ⇒ String
Path to Certification Key file.
Instance Method Summary collapse
-
#initialize(hsh = {}) ⇒ CertificationConfiguration
constructor
A new instance of CertificationConfiguration.
-
#to_effective_config(effective_config) ⇒ Object
Converts current configuration to effective config values class and appends them to EffectiveConfig class.
Methods included from Contrast::Components::ComponentBase
#canon_name, #config_values, #false?, #file_exists?, #stringify_array, #true?, #valid_cert?
Methods included from Diagnostics::Tools
#add_effective_config_values, #add_single_effective_value
Methods included from Diagnostics::SingletonTools
#flatten_settings, #to_config_values, #update_config, #value_to_s
Methods included from BaseConfiguration
Constructor Details
#initialize(hsh = {}) ⇒ CertificationConfiguration
Returns a new instance of CertificationConfiguration.
24 25 26 27 28 29 30 31 |
# File 'lib/contrast/config/certification_configuration.rb', line 24 def initialize hsh = {} return unless hsh @enable = hsh[:enable] @ca_file = hsh[:ca_file] @cert_file = hsh[:cert_file] @key_file = hsh[:key_file] end |
Instance Attribute Details
#ca_file ⇒ String
Returns path to CA Cert file.
17 18 19 |
# File 'lib/contrast/config/certification_configuration.rb', line 17 def ca_file @ca_file end |
#cert_file ⇒ String
Returns path to Certification file.
19 20 21 |
# File 'lib/contrast/config/certification_configuration.rb', line 19 def cert_file @cert_file end |
#enable ⇒ Boolean, false
34 35 36 |
# File 'lib/contrast/config/certification_configuration.rb', line 34 def enable @enable.nil? ? false : @enable end |
#key_file ⇒ String
Returns path to Certification Key file.
21 22 23 |
# File 'lib/contrast/config/certification_configuration.rb', line 21 def key_file @key_file end |
Instance Method Details
#to_effective_config(effective_config) ⇒ Object
Converts current configuration to effective config values class and appends them to EffectiveConfig class.
42 43 44 |
# File 'lib/contrast/config/certification_configuration.rb', line 42 def to_effective_config effective_config add_effective_config_values(effective_config, CONFIG_VALUES, CANON_NAME) end |