Class: AppMap::Inspect::MethodParseNode

Inherits:
ParseNode show all
Defined in:
lib/appmap/inspect/parse_node.rb

Overview

Abstract representation of a method.

Instance Attribute Summary

Attributes inherited from ParseNodeStruct

#ancestors, #file_path, #node

Instance Method Summary collapse

Methods inherited from ParseNode

#enclosing_type_node, from_node, #parent_node, #preceding_sibling_nodes, #public?

Instance Method Details

#enclosing_namesObject



83
84
85
86
87
88
89
# File 'lib/appmap/inspect/parse_node.rb', line 83

def enclosing_names
  ancestors.select do |a|
    %i[class module].include?(a.type)
  end.map do |a|
    send("extract_#{a.type}_name", a)
  end
end

#to_feature(attributes) ⇒ Object



76
77
78
79
80
81
# File 'lib/appmap/inspect/parse_node.rb', line 76

def to_feature(attributes)
  AppMap::Feature::Function.new(name, "#{file_path}:#{location.line}", attributes).tap do |a|
    a.static = static?
    a.class_name = class_name
  end
end