Class: Contrast::Agent::Telemetry::Exception::Event

Inherits:
Base
  • Object
show all
Defined in:
lib/contrast/agent/telemetry/exception/event.rb

Overview

This class will hold the basic information for a Parent Telemetry Exception Event

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ Event

Initialization of the Parent Event requires us to require the exception to be created

@raise



22
23
24
25
26
# File 'lib/contrast/agent/telemetry/exception/event.rb', line 22

def initialize message
  super()
  validate_class(message, Contrast::Agent::Telemetry::Exception::Message, 'exception_message')
  @exceptions = Array.new(1, message)
end

Instance Attribute Details

#exceptionsArray<Contrast::Agent::Telemetry::Exception::Message> (readonly)

Array of Telemetry Exceptions



15
16
17
# File 'lib/contrast/agent/telemetry/exception/event.rb', line 15

def exceptions
  @exceptions
end

Class Method Details

.pathObject



35
36
37
# File 'lib/contrast/agent/telemetry/exception/event.rb', line 35

def self.path
  '/error'
end

Instance Method Details

#push(message) ⇒ Object



30
31
32
33
# File 'lib/contrast/agent/telemetry/exception/event.rb', line 30

def push message
  validate_class(message, Contrast::Agent::Telemetry::Exception::Message, 'exception_message')
  @exceptions << message
end

#to_controlled_hashObject



39
40
41
# File 'lib/contrast/agent/telemetry/exception/event.rb', line 39

def to_controlled_hash
  exceptions.map(&:to_controlled_hash)
end