Class: Contrast::Agent::Reporting::Settings::VirtualPatch

Inherits:
Object
  • Object
show all
Defined in:
lib/contrast/agent/reporting/settings/virtual_patch.rb

Overview

The settings for each virtual patch in the agent.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ VirtualPatch

Returns a new instance of VirtualPatch.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/contrast/agent/reporting/settings/virtual_patch.rb', line 20

def initialize hash
  @name = hash[:name]
  @key = hash[:key]
  @uuid = hash[:uuid]

  hash[:headers]&.each do |header_json|
    headers << Contrast::Agent::Reporting::Settings::VirtualPatchCondition.new(header_json)
  end

  hash[:parameters]&.each do |header_json|
    parameters << Contrast::Agent::Reporting::Settings::VirtualPatchCondition.new(header_json)
  end

  hash[:urls]&.each do |header_json|
    urls << Contrast::Agent::Reporting::Settings::VirtualPatchCondition.new(header_json)
  end
end

Instance Attribute Details

#keyString (readonly)

Returns:



16
17
18
# File 'lib/contrast/agent/reporting/settings/virtual_patch.rb', line 16

def key
  @key
end

#nameString (readonly)

Returns:



14
15
16
# File 'lib/contrast/agent/reporting/settings/virtual_patch.rb', line 14

def name
  @name
end

#uuidString (readonly)

Returns:



18
19
20
# File 'lib/contrast/agent/reporting/settings/virtual_patch.rb', line 18

def uuid
  @uuid
end

Instance Method Details

#headersArray<Contrast::Agent::Reporting::Settings::VirtualPatchCondition>



39
40
41
# File 'lib/contrast/agent/reporting/settings/virtual_patch.rb', line 39

def headers
  @_headers ||= []
end

#parametersArray<Contrast::Agent::Reporting::Settings::VirtualPatchCondition>



44
45
46
# File 'lib/contrast/agent/reporting/settings/virtual_patch.rb', line 44

def parameters
  @_parameters ||= []
end

#urlsArray<Contrast::Agent::Reporting::Settings::VirtualPatchCondition>



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

def urls
  @_urls ||= []
end