Class: Analyst::Entities::Class

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

Instance Method Summary collapse

Methods inherited from Module

#full_name, #name

Instance Method Details

#all_methodsObject



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

def all_methods
  cmethods + imethods
end

#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



27
28
29
# File 'lib/analyst/entities/class.rb', line 27

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