Class: Contrast::Agent::Reporting::ApplicationUpdate
- Inherits:
-
ApplicationReportingEvent
- Object
- ReportableHash
- ReportingEvent
- ApplicationReportingEvent
- Contrast::Agent::Reporting::ApplicationUpdate
- Defined in:
- lib/contrast/agent/reporting/reporting_events/application_update.rb
Overview
This is the new Application Update class which will include all the needed information for the new reporting system. Contains data used by TeamServer to render the Flow Map and SCA features.
Instance Attribute Summary collapse
-
#components ⇒ Array<Contrast::Agent::Reporting::ArchitectureComponent>
readonly
The current value of components.
-
#libraries ⇒ Object
Returns the value of attribute libraries.
Attributes inherited from ReportingEvent
#event_endpoint, #event_method
Instance Method Summary collapse
- #file_name ⇒ Object
-
#initialize ⇒ ApplicationUpdate
constructor
A new instance of ApplicationUpdate.
-
#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
Ensure the required fields are present.
Methods inherited from ReportingEvent
Methods inherited from ReportableHash
Methods included from Components::Logger::InstanceMethods
Constructor Details
#initialize ⇒ ApplicationUpdate
Returns a new instance of ApplicationUpdate.
22 23 24 25 26 27 28 |
# File 'lib/contrast/agent/reporting/reporting_events/application_update.rb', line 22 def initialize @event_method = :PUT @event_endpoint = "#{ Contrast::API.api_url }/api/ng/update/application" @components = [] @libraries = [] super() end |
Instance Attribute Details
#components ⇒ Array<Contrast::Agent::Reporting::ArchitectureComponent> (readonly)
Returns the current value of components.
18 19 20 |
# File 'lib/contrast/agent/reporting/reporting_events/application_update.rb', line 18 def components @components end |
#libraries ⇒ Object
Returns the value of attribute libraries.
20 21 22 |
# File 'lib/contrast/agent/reporting/reporting_events/application_update.rb', line 20 def libraries @libraries end |
Instance Method Details
#file_name ⇒ Object
30 31 32 |
# File 'lib/contrast/agent/reporting/reporting_events/application_update.rb', line 30 def file_name 'update-application' end |
#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.
39 40 41 42 43 44 45 46 |
# File 'lib/contrast/agent/reporting/reporting_events/application_update.rb', line 39 def to_controlled_hash validate { components: components.map(&:to_controlled_hash), libraries: libraries.map(&:to_controlled_hash), timestamp: since_last_update } end |
#validate ⇒ Object
Ensure the required fields are present.
51 |
# File 'lib/contrast/agent/reporting/reporting_events/application_update.rb', line 51 def validate; end |