Class: Contrast::Agent::Reporting::Settings::InputExclusion

Inherits:
ExclusionBase show all
Defined in:
lib/contrast/agent/reporting/settings/input_exclusion.rb

Overview

InputExclusions class

Constant Summary collapse

ATTRIBUTES =
BASE_ATTRIBUTES.dup << :type
VALID_INPUT_TYPES =
%w[COOKIE PARAMETER HEADER BODY QUERYSTRING].cs__freeze

Constants inherited from ExclusionBase

ExclusionBase::BASE_ATTRIBUTES, ExclusionBase::STRATEGIES

Instance Attribute Summary

Attributes inherited from ExclusionBase

#modes, #urls

Instance Method Summary collapse

Methods inherited from ExclusionBase

#assess, #assess_rules, #assess_rules=, #initialize, #match_strategy, #match_strategy=, #protect, #protect_rules, #protect_rules=

Constructor Details

This class inherits a constructor from Contrast::Agent::Reporting::Settings::ExclusionBase

Instance Method Details

#input_nameString?

Used by the ng endpoints. This is getter for input type. This may be filled as alternative to name as the ng endpoint is still using it.

Returns:

  • (String, nil)

    the name of the input to match



45
46
47
# File 'lib/contrast/agent/reporting/settings/input_exclusion.rb', line 45

def input_name
  @_input_name ||= Contrast::Utils::ObjectShare::EMPTY_STRING
end

#nameObject



31
32
33
# File 'lib/contrast/agent/reporting/settings/input_exclusion.rb', line 31

def name
  @_name ||= input_name
end

#name=(new_name) ⇒ Object

Parameters:

  • new_name (String)

    Set new input type.



37
38
39
# File 'lib/contrast/agent/reporting/settings/input_exclusion.rb', line 37

def name= new_name
  @_name = new_name
end

#to_controlled_hashObject



49
50
51
52
53
# File 'lib/contrast/agent/reporting/settings/input_exclusion.rb', line 49

def to_controlled_hash
  hash = super
  hash[:type] = type
  hash
end

#typeObject



20
21
22
# File 'lib/contrast/agent/reporting/settings/input_exclusion.rb', line 20

def type
  @_type ||= input_type
end

#type=(new_type) ⇒ Object

Parameters:

  • new_type (String)

    Set new input type.



26
27
28
# File 'lib/contrast/agent/reporting/settings/input_exclusion.rb', line 26

def type= new_type
  @_type = new_type if VALID_INPUT_TYPES.include?(new_type)
end