Class: Contrast::Agent::Reporting::FindingEventParentObject
- Inherits:
-
ReportableHash
- Object
- ReportableHash
- Contrast::Agent::Reporting::FindingEventParentObject
- Defined in:
- lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb
Overview
This is the new FindingEventParentObject class which will include all the needed information for the new reporting system to relay this information in the Finding/Trace messages. These FindingEventParentObject are used by TeamServer to relate this event to those that came previously. They represent the events that directly preceding the FindingEvent generated.
Instance Attribute Summary collapse
-
#id ⇒ Integer
readonly
The Id of the parent event.
Instance Method Summary collapse
-
#initialize(id) ⇒ FindingEventParentObject
constructor
A new instance of FindingEventParentObject.
-
#to_controlled_hash ⇒ Hash
Convert the instance variables on the class, and other information, into the identifiers required for TeamServer to process the JSON form of this message.
- #validate ⇒ Object
Methods inherited from ReportableHash
Methods included from Components::Logger::InstanceMethods
Constructor Details
#initialize(id) ⇒ FindingEventParentObject
Returns a new instance of FindingEventParentObject.
19 20 21 22 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb', line 19 def initialize id @id = id super() end |
Instance Attribute Details
#id ⇒ Integer (readonly)
Returns the Id of the parent event.
17 18 19 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb', line 17 def id @id end |
Instance Method Details
#to_controlled_hash ⇒ Hash
Convert the instance variables on the class, and other information, into the identifiers required for TeamServer to process the JSON form of this message.
29 30 31 32 33 34 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb', line 29 def to_controlled_hash validate { id: id } end |
#validate ⇒ Object
37 38 39 40 41 |
# File 'lib/contrast/agent/reporting/reporting_events/finding_event_parent_object.rb', line 37 def validate return unless Contrast::Utils::DuckUtils.empty_duck?(id) raise(ArgumentError, "#{ self } did not have a proper id. Unable to continue.") end |