Class: AppMap::Feature::Cls

Inherits:
Base show all
Defined in:
lib/appmap/feature.rb

Overview

Cls is a feature which represents a code class. A class defines a namespace which contains other features (such as member classes and functions), and it also usually encapsulates some data on which the member features operate.

Instance Attribute Summary

Attributes inherited from Base

#children, #parent

Attributes inherited from FeatureStruct

#attributes, #location, #name

Instance Method Summary collapse

Methods inherited from Base

#add_child, #collect_functions, #enclosing_type_name, #enclosing_type_name?, expand_path, #include_option, #initialize, #prune, #remove_child, #reparent, #to_h, #to_json, #valid?

Constructor Details

This class inherits a constructor from AppMap::Feature::Base

Instance Method Details

#prune?Boolean

prune a class if it’s empty.

Returns:

  • (Boolean)


209
210
211
# File 'lib/appmap/feature.rb', line 209

def prune?
  children.empty?
end

#type?Boolean

Returns:

  • (Boolean)


213
214
215
# File 'lib/appmap/feature.rb', line 213

def type?
  true
end

#type_nameObject

Gets the type name of this class as an array.



218
219
220
# File 'lib/appmap/feature.rb', line 218

def type_name
  @type_name ||= enclosing_type_name + [ name ]
end