Class: ApplicationInsights::Channel::Contracts::ExceptionData

Inherits:
JsonSerializable
  • Object
show all
Defined in:
lib/application_insights/channel/contracts/exception_data.rb

Overview

Data contract class for type ExceptionData.

Instance Method Summary collapse

Methods inherited from JsonSerializable

#to_h, #to_json

Constructor Details

#initialize(options = {}) ⇒ ExceptionData

Initializes a new instance of the ExceptionData class.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 9

def initialize(options={})
  defaults = {
    'ver' => 2,
    'handledAt' => nil,
    'exceptions' => [],
    'severityLevel' => nil,
    'problemId' => nil,
    'crashThreadId' => nil,
    'properties' => {},
    'measurements' => {}
  }
  values = {
    'ver' => 2,
    'handledAt' => nil,
    'exceptions' => []
  }
  super defaults, values, options
end

Instance Method Details

#crash_thread_idObject

Gets the crash_thread_id property.



91
92
93
94
95
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 91

def crash_thread_id
  @values.fetch('crashThreadId') { 
    @values['crashThreadId'] = nil
  }
end

#crash_thread_id=(value) ⇒ Object

Sets the crash_thread_id property.



98
99
100
101
102
103
104
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 98

def crash_thread_id=(value)
  if value == @defaults['crashThreadId']
    @values.delete 'crashThreadId' if @values.key? 'crashThreadId'
  else
    @values['crashThreadId'] = value
  end
end

#exceptionsObject

Gets the exceptions property.



49
50
51
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 49

def exceptions
  @values['exceptions']
end

#exceptions=(value) ⇒ Object

Sets the exceptions property.



54
55
56
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 54

def exceptions=(value)
  @values['exceptions'] = value
end

#handled_atObject

Gets the handled_at property.



39
40
41
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 39

def handled_at
  @values['handledAt']
end

#handled_at=(value) ⇒ Object

Sets the handled_at property.



44
45
46
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 44

def handled_at=(value)
  @values['handledAt'] = value
end

#measurementsObject

Gets the measurements property.



123
124
125
126
127
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 123

def measurements
  @values.fetch('measurements') { 
    @values['measurements'] = {}
  }
end

#measurements=(value) ⇒ Object

Sets the measurements property.



130
131
132
133
134
135
136
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 130

def measurements=(value)
  if value == @defaults['measurements']
    @values.delete 'measurements' if @values.key? 'measurements'
  else
    @values['measurements'] = value
  end
end

#problem_idObject

Gets the problem_id property.



75
76
77
78
79
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 75

def problem_id
  @values.fetch('problemId') { 
    @values['problemId'] = nil
  }
end

#problem_id=(value) ⇒ Object

Sets the problem_id property.



82
83
84
85
86
87
88
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 82

def problem_id=(value)
  if value == @defaults['problemId']
    @values.delete 'problemId' if @values.key? 'problemId'
  else
    @values['problemId'] = value
  end
end

#propertiesObject

Gets the properties property.



107
108
109
110
111
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 107

def properties
  @values.fetch('properties') { 
    @values['properties'] = {}
  }
end

#properties=(value) ⇒ Object

Sets the properties property.



114
115
116
117
118
119
120
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 114

def properties=(value)
  if value == @defaults['properties']
    @values.delete 'properties' if @values.key? 'properties'
  else
    @values['properties'] = value
  end
end

#severity_levelObject

Gets the severity_level property.



59
60
61
62
63
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 59

def severity_level
  @values.fetch('severityLevel') { 
    @values['severityLevel'] = nil
  }
end

#severity_level=(value) ⇒ Object

Sets the severity_level property.



66
67
68
69
70
71
72
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 66

def severity_level=(value)
  if value == @defaults['severityLevel']
    @values.delete 'severityLevel' if @values.key? 'severityLevel'
  else
    @values['severityLevel'] = value
  end
end

#verObject

Gets the ver property.



29
30
31
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 29

def ver
  @values['ver']
end

#ver=(value) ⇒ Object

Sets the ver property.



34
35
36
# File 'lib/application_insights/channel/contracts/exception_data.rb', line 34

def ver=(value)
  @values['ver'] = value
end