Class: Analyst::Entities::Class
Instance Attribute Summary
Attributes inherited from Entity
#ast, #parent
Instance Method Summary
collapse
Methods inherited from Module
#full_name, #name
Methods inherited from Entity
#classes, #conditionals, #constants, #file_path, #full_name, handles_node, #initialize, #inspect, #line_number, #location, #method_calls, #methods, #modules, #origin_source, #source, #top_level_classes, #top_level_constants, #top_level_modules
Instance Method Details
#all_methods ⇒ Object
29
30
31
|
# File 'lib/analyst/entities/class.rb', line 29
def all_methods
cmethods + imethods
end
|
#cmethods ⇒ Object
23
24
25
26
27
|
# File 'lib/analyst/entities/class.rb', line 23
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
|
#imethods ⇒ Object
19
20
21
|
# File 'lib/analyst/entities/class.rb', line 19
def imethods
@imethods ||= contents.select { |entity| entity.is_a? Analyst::Entities::InstanceMethod }
end
|
#kind ⇒ Object
15
16
17
|
# File 'lib/analyst/entities/class.rb', line 15
def kind
"Class"
end
|
#singleton_class_blocks ⇒ Object
33
34
35
|
# File 'lib/analyst/entities/class.rb', line 33
def singleton_class_blocks
contents.select { |entity| entity.is_a? Analyst::Entities::SingletonClass }
end
|