Module: Neo4Apis::Neolytics::TracePointHelpers
- Defined in:
- lib/neo4apis/neolytics/trace_point_helpers.rb
Constant Summary collapse
- FILE_LINES =
{}
Class Method Summary collapse
Class Method Details
.each_received_arguments(tp) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/neo4apis/neolytics/trace_point_helpers.rb', line 9 def each_received_arguments(tp) # Can't just use #method method because some objects implement a #method method method = if tp.self.class.instance_method(:method).source_location.nil? tp.self.method(tp.method_id) else tp.self.class.instance_method(tp.method_id) end parameter_names = method.parameters.map {|_, name| name } arguments = parameter_names.each_with_object({}) do |name, arguments| catch :not_found do arguments[name] = get_trace_point_var(tp, name) end end arguments.each do |name, object| value = RubyObject.from_object(object) yield name, value end end |
.each_referenced_variable(tp) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/neo4apis/neolytics/trace_point_helpers.rb', line 28 def each_referenced_variable(tp) line = get_file_line(tp.path, tp.lineno) root = Parser::CurrentRuby.parse(line) extract_variables(root).each do |variable| catch :not_found do value = get_trace_point_var(tp, variable) yield variable, value end end rescue Parser::SyntaxError nil end |