Class: Threatstack::Events::InstrumentationEvent
- Defined in:
- lib/events/models/instrumentation_event.rb
Overview
Instrumentation event model that inherits the common attributes and adds its own specifics
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#line_num ⇒ Object
Returns the value of attribute line_num.
-
#method_name ⇒ Object
Returns the value of attribute method_name.
-
#module_name ⇒ Object
Returns the value of attribute module_name.
Attributes inherited from BaseEvent
#agent_type, #event_id, #event_type, #timestamp
Instance Method Summary collapse
-
#initialize(args) ⇒ InstrumentationEvent
constructor
A new instance of InstrumentationEvent.
- #to_hash ⇒ Object
Methods inherited from BaseEvent
#to_core_hash, #to_json_string
Constructor Details
#initialize(args) ⇒ InstrumentationEvent
Returns a new instance of InstrumentationEvent.
22 23 24 25 26 27 28 29 30 |
# File 'lib/events/models/instrumentation_event.rb', line 22 def initialize(args) args[:event_type] = 'instrumentation' @module_name = args[:module_name] @method_name = args[:method_name] @file_path = args[:file_path] @line_num = args[:line_num] @arguments = args[:arguments] super args end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
14 15 16 |
# File 'lib/events/models/instrumentation_event.rb', line 14 def arguments @arguments end |
#file_path ⇒ Object
Returns the value of attribute file_path.
12 13 14 |
# File 'lib/events/models/instrumentation_event.rb', line 12 def file_path @file_path end |
#line_num ⇒ Object
Returns the value of attribute line_num.
13 14 15 |
# File 'lib/events/models/instrumentation_event.rb', line 13 def line_num @line_num end |
#method_name ⇒ Object
Returns the value of attribute method_name.
11 12 13 |
# File 'lib/events/models/instrumentation_event.rb', line 11 def method_name @method_name end |
#module_name ⇒ Object
Returns the value of attribute module_name.
10 11 12 |
# File 'lib/events/models/instrumentation_event.rb', line 10 def module_name @module_name end |
Instance Method Details
#to_hash ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/events/models/instrumentation_event.rb', line 32 def to_hash hash = to_core_hash hash[:module_name] = @module_name hash[:method_name] = @method_name hash[:line_num] = @line_num hash[:file_path] = @file_path hash[:payload] = { :arguments => @arguments } hash end |