Module: Analyst::Entities::HasMethods
Instance Method Summary collapse
Instance Method Details
#all_methods ⇒ Object
17 18 19 |
# File 'lib/analyst/entities/mixins/has_methods.rb', line 17 def all_methods cmethods + imethods end |
#cmethods ⇒ Object
11 12 13 14 15 |
# File 'lib/analyst/entities/mixins/has_methods.rb', line 11 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
7 8 9 |
# File 'lib/analyst/entities/mixins/has_methods.rb', line 7 def imethods @imethods ||= contents.select { |entity| entity.is_a? Analyst::Entities::InstanceMethod } end |
#singleton_class_blocks ⇒ Object
21 22 23 |
# File 'lib/analyst/entities/mixins/has_methods.rb', line 21 def singleton_class_blocks contents.select { |entity| entity.is_a? Analyst::Entities::SingletonClass } end |