Class: Contrast::Agent::Protect::Rule::InputClassification::Rates
- Defined in:
- lib/contrast/agent/protect/rule/input_classification/rates.rb
Overview
This class will hold match information when input classification is being saved in LRU cache.
Direct Known Subclasses
Constant Summary collapse
- FIELD_NAME =
Titles:
'ia'
- TEST_NAME =
'_t'
Instance Attribute Summary collapse
- #input_type ⇒ Symbol? readonly
- #rule_id ⇒ String readonly
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(rule_id, input_type) ⇒ Rates
constructor
A new instance of Rates.
-
#to_fields ⇒ Hash
Override this method to return the required Agent Telemetry fields.
Constructor Details
#initialize(rule_id, input_type) ⇒ Rates
Returns a new instance of Rates.
23 24 25 26 |
# File 'lib/contrast/agent/protect/rule/input_classification/rates.rb', line 23 def initialize rule_id, input_type @rule_id = rule_id if rule_id @input_type = input_type if Contrast::Agent::Reporting::InputType.to_a.include?(input_type) end |
Instance Attribute Details
#input_type ⇒ Symbol? (readonly)
21 22 23 |
# File 'lib/contrast/agent/protect/rule/input_classification/rates.rb', line 21 def input_type @input_type end |
#rule_id ⇒ String (readonly)
19 20 21 |
# File 'lib/contrast/agent/protect/rule/input_classification/rates.rb', line 19 def rule_id @rule_id end |
Instance Method Details
#empty? ⇒ Boolean
28 29 30 |
# File 'lib/contrast/agent/protect/rule/input_classification/rates.rb', line 28 def empty? Contrast::Utils::DuckUtils.empty_duck?(@input_type) end |
#to_fields ⇒ Hash
Override this method to return the required Agent Telemetry fields.
34 35 36 |
# File 'lib/contrast/agent/protect/rule/input_classification/rates.rb', line 34 def to_fields {} end |