Class: Analyst::Entities::Class

Inherits:
Module show all
Defined in:
lib/analyst/entities/class.rb

Instance Attribute Summary

Attributes inherited from Entity

#parent

Instance Method Summary collapse

Methods inherited from Module

#full_name, #name

Methods inherited from Entity

#classes, #full_name, #handle_send_node, #initialize, #inspect, #method_calls, #top_level_classes, #top_level_modules

Constructor Details

This class inherits a constructor from Analyst::Entities::Entity

Instance Method Details

#cmethodsObject



17
18
19
20
21
# File 'lib/analyst/entities/class.rb', line 17

def cmethods
  some_methods = smethods.select { |method| method.target.type == :self }
  other_methods = singleton_class_blocks { |block| block.target.type == :self }.map(&:smethods).flatten
  some_methods + other_methods
end

#imethodsObject



13
14
15
# File 'lib/analyst/entities/class.rb', line 13

def imethods
  @imethods ||= contents.select { |entity| entity.is_a? Analyst::Entities::InstanceMethod }
end

#singleton_class_blocksObject



23
24
25
# File 'lib/analyst/entities/class.rb', line 23

def singleton_class_blocks
  contents.select { |entity| entity.is_a? Analyst::Entities::SingletonClass }
end