Class: Contrast::Agent::Reporting::Settings::Reaction
- Defined in:
- lib/contrast/agent/reporting/settings/reaction.rb
Overview
Reaction the agent should take based on a state in TS.
Constant Summary collapse
- OPERATIONS =
used to check the parameters and also before reactions settings update
%w[NOOP DISABLE].cs__freeze
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#message ⇒ Object
Returns the value of attribute message.
-
#operation ⇒ Object
Returns the value of attribute operation.
Instance Method Summary collapse
-
#initialize(level, operation, message) ⇒ Reaction
constructor
Reaction the agent should take based on a state in TS.
- #to_controlled_hash ⇒ Object
Constructor Details
#initialize(level, operation, message) ⇒ Reaction
Reaction the agent should take based on a state in TS.
22 23 24 25 26 |
# File 'lib/contrast/agent/reporting/settings/reaction.rb', line 22 def initialize level, operation, @level = level if Contrast::Agent::Reporting::Settings::LogEnhancer::LOG_LEVELS.include?(level) @operation = operation if OPERATIONS.include?(operation) @message = if .is_a?(String) end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
12 13 14 |
# File 'lib/contrast/agent/reporting/settings/reaction.rb', line 12 def level @level end |
#message ⇒ Object
Returns the value of attribute message.
12 13 14 |
# File 'lib/contrast/agent/reporting/settings/reaction.rb', line 12 def @message end |
#operation ⇒ Object
Returns the value of attribute operation.
12 13 14 |
# File 'lib/contrast/agent/reporting/settings/reaction.rb', line 12 def operation @operation end |
Instance Method Details
#to_controlled_hash ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/contrast/agent/reporting/settings/reaction.rb', line 28 def to_controlled_hash { message: , level: level, operation: operation } end |