Module: Contrast::Config::BaseConfiguration
- Extended by:
- Forwardable
- Included in:
- Contrast::Components::Api::Interface, Contrast::Components::AppContext::Interface, Contrast::Components::AssessRules::Interface, Contrast::Components::HeapDump::Interface, Contrast::Components::Protect::Interface, Contrast::Components::Sampling::Interface, ApiProxyConfiguration, CertificationConfiguration, ExceptionConfiguration, ProtectRuleConfiguration, ProtectRulesConfiguration, RequestAuditConfiguration, ServerConfiguration, Contrast::Configuration
- Defined in:
- lib/contrast/config/base_configuration.rb
Overview
This is the base for our configuration classes. It is intended to facilitate the translation of the Common Configuration settings to usable Ruby classes.
Constant Summary collapse
- AT_UNDERSCORE =
'@_'
Instance Method Summary collapse
Instance Method Details
#to_contrast_hash ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/contrast/config/base_configuration.rb', line 15 def to_contrast_hash hsh = {} instance_variables.each do |iv| # strip the '@' of '@_' to get the key string_iv = iv.to_s key = if string_iv.include?(AT_UNDERSCORE) string_iv[2..] else string_iv[1..] end hsh[key] = send(key.to_sym) end hsh end |