Sha256: a1a1a8474c30c27ebd4567e2d5e1bd7282cb597cdd94c65d15be7e362d6e5d71

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'contrast/components/logger'
require 'contrast/utils/assess/trigger_method_utils'

module Contrast
  module Agent
    module Reporting
      # This is the new ReportingEvent class which will include all the needed and mutual information
      # for the new reporting system
      # @abstract
      class ReportingEvent
        attr_reader :routes
        attr_accessor :event_type

        CODE = :TRACE

        def initialize(*) # rubocop:disable Style/MethodDefParentheses
          @event_type = Contrast::Utils::ObjectShare::EMPTY_STRING
          @agent_session_id_value = 0
          @routes = []
        end

        def to_controlled_hash **_args
          { code: CODE, routes: routes }
        end

        def validate
          raise(ArgumentError, "#{ self } did not have a proper routes. Unable to continue.") if routes.empty?

          nil
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contrast-agent-4.14.1 lib/contrast/agent/reporting/reporting_events/reporting_event.rb
contrast-agent-4.14.0 lib/contrast/agent/reporting/reporting_events/reporting_event.rb