Class: AppMap::Rails::ActionHandler::HTTPServerRequest::Call

Inherits:
Event::MethodCall show all
Defined in:
lib/appmap/rails/action_handler.rb

Constant Summary

Constants inherited from Event::MethodEvent

Event::MethodEvent::LIMIT

Instance Attribute Summary collapse

Attributes inherited from Event::MethodCall

#defined_class, #lineno, #method_id, #parameters, #path, #receiver, #static

Attributes inherited from Event::MethodEventStruct

#event, #id, #thread_id

Instance Method Summary collapse

Methods inherited from Event::MethodCall

build_from_invocation

Methods inherited from Event::MethodEvent

build_from_invocation, display_string

Constructor Details

#initialize(payload) ⇒ Call



22
23
24
25
26
# File 'lib/appmap/rails/action_handler.rb', line 22

def initialize(payload)
  super AppMap::Event.next_id_counter, :call, Thread.current.object_id

  self.payload = payload
end

Instance Attribute Details

#payloadObject

Returns the value of attribute payload.



20
21
22
# File 'lib/appmap/rails/action_handler.rb', line 20

def payload
  @payload
end

Instance Method Details

#to_hObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/appmap/rails/action_handler.rb', line 28

def to_h
  super.tap do |h|
    h[:http_server_request] = {
      request_method: payload[:method],
      path_info: payload[:path]
    }

    params = payload[:params]
    h[:message] = params.keys.map do |key|
      val = params[key]
      {
        name: key,
        class: val.class.name,
        value: self.class.display_string(val),
        object_id: val.__id__
      }
    end
  end
end