Class: AppMap::Event::MethodCall
- Inherits:
-
MethodEvent
- Object
- Struct
- MethodEventStruct
- MethodEvent
- AppMap::Event::MethodCall
- Defined in:
- lib/appmap/event.rb
Constant Summary
Constants inherited from MethodEvent
AppMap::Event::MethodEvent::LIMIT
Instance Attribute Summary collapse
-
#parameters ⇒ Object
Returns the value of attribute parameters.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
-
#static ⇒ Object
(also: #static?)
Returns the value of attribute static.
Attributes inherited from MethodEventStruct
#defined_class, #event, #id, #lineno, #method_id, #path, #thread_id
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from MethodEvent
Instance Attribute Details
#parameters ⇒ Object
Returns the value of attribute parameters.
65 66 67 |
# File 'lib/appmap/event.rb', line 65 def parameters @parameters end |
#receiver ⇒ Object
Returns the value of attribute receiver.
65 66 67 |
# File 'lib/appmap/event.rb', line 65 def receiver @receiver end |
#static ⇒ Object Also known as: static?
Returns the value of attribute static.
65 66 67 |
# File 'lib/appmap/event.rb', line 65 def static @static end |
Class Method Details
.build_from_invocation(mc = MethodCall.new, defined_class, method, receiver, arguments) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/appmap/event.rb', line 68 def build_from_invocation(mc = MethodCall.new, defined_class, method, receiver, arguments) mc.tap do mc.parameters = method.parameters.map.with_index do |method_param, idx| param_type, param_name = method_param param_name ||= 'arg' value = arguments[idx] { name: param_name, class: value.class.name, object_id: value.__id__, value: display_string(value), kind: param_type } end mc.receiver = { class: receiver.class.name, object_id: receiver.__id__, value: display_string(receiver) } mc.static = receiver.is_a?(Module) MethodEvent.build_from_invocation(mc, :call, defined_class, method) end end |
Instance Method Details
#to_h ⇒ Object
93 94 95 96 97 98 99 |
# File 'lib/appmap/event.rb', line 93 def to_h super.tap do |h| h[:static] = static h[:parameters] = parameters h[:receiver] = receiver end end |