Class: AppMap::Handler::Rails::SQLHandler::SQLCall
- Inherits:
-
Event::MethodCall
- Object
- Struct
- Event::MethodEventStruct
- Event::MethodEvent
- Event::MethodCall
- AppMap::Handler::Rails::SQLHandler::SQLCall
- Defined in:
- lib/appmap/handler/rails/sql_handler.rb
Constant Summary
Constants inherited from Event::MethodEvent
Instance Attribute Summary collapse
-
#payload ⇒ Object
Returns the value of attribute payload.
Attributes inherited from Event::MethodCall
#defined_class, #lineno, #method_id, #parameters, #path, #receiver, #static
Attributes inherited from Event::MethodEventStruct
Instance Method Summary collapse
-
#initialize(payload) ⇒ SQLCall
constructor
A new instance of SQLCall.
- #to_h ⇒ Object
Methods inherited from Event::MethodCall
Methods inherited from Event::MethodEvent
best_class_name, build_from_invocation, custom_display_string, default_display_string, display_string, object_properties
Constructor Details
#initialize(payload) ⇒ SQLCall
Returns a new instance of SQLCall.
12 13 14 15 16 |
# File 'lib/appmap/handler/rails/sql_handler.rb', line 12 def initialize(payload) super AppMap::Event.next_id_counter, :call, Thread.current.object_id self.payload = payload end |
Instance Attribute Details
#payload ⇒ Object
Returns the value of attribute payload.
10 11 12 |
# File 'lib/appmap/handler/rails/sql_handler.rb', line 10 def payload @payload end |
Instance Method Details
#to_h ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/appmap/handler/rails/sql_handler.rb', line 18 def to_h super.tap do |h| h[:sql_query] = { sql: payload[:sql], database_type: payload[:database_type] }.tap do |sql_query| %i[server_version].each do |attribute| sql_query[attribute] = payload[attribute] if payload[attribute] end end end end |