Class: Contrast::Config::ExceptionConfiguration
- Defined in:
- lib/contrast/config/exception_configuration.rb
Overview
Common Configuration settings. Those in this section pertain to the exception handling in Ruby, allowing for the override of Response Code and Message when Security Exceptions are raised.
Constant Summary collapse
- CANON_NAME =
'agent.ruby.exception'
- CONFIG_VALUES =
%w[capture override_status override_message].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
- #canon_name ⇒ String readonly
- #capture ⇒ Boolean, false
- #config_values ⇒ Array readonly
-
#override_message ⇒ String
The message text override.
-
#override_status ⇒ Integer
The HTTP status code override.
Instance Method Summary collapse
-
#initialize(hsh = {}) ⇒ ExceptionConfiguration
constructor
A new instance of ExceptionConfiguration.
Methods included from Contrast::Components::ComponentBase
#false?, #file_exists?, #stringify_array, #to_effective_config, #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 = {}) ⇒ ExceptionConfiguration
Returns a new instance of ExceptionConfiguration.
27 28 29 30 31 32 33 34 35 |
# File 'lib/contrast/config/exception_configuration.rb', line 27 def initialize hsh = {} @config_values = CONFIG_VALUES @canon_name = CANON_NAME return unless hsh @capture = hsh[:capture] @override_status = hsh[:override_status] @override_message = hsh[:override_message] end |
Instance Attribute Details
#canon_name ⇒ String (readonly)
23 24 25 |
# File 'lib/contrast/config/exception_configuration.rb', line 23 def canon_name @canon_name end |
#capture ⇒ Boolean, false
38 39 40 |
# File 'lib/contrast/config/exception_configuration.rb', line 38 def capture !!@capture end |
#config_values ⇒ Array (readonly)
25 26 27 |
# File 'lib/contrast/config/exception_configuration.rb', line 25 def config_values @config_values end |
#override_message ⇒ String
Returns the message text override.
20 21 22 |
# File 'lib/contrast/config/exception_configuration.rb', line 20 def @override_message end |
#override_status ⇒ Integer
Returns the HTTP status code override.
18 19 20 |
# File 'lib/contrast/config/exception_configuration.rb', line 18 def override_status @override_status end |