module T::AbstractUtils
def self.abstract_methods_for(mod)
Given a module, returns the set of methods declared as abstract (in itself or ancestors)
def self.abstract_methods_for(mod) declared_methods = declared_abstract_methods_for(mod) declared_methods.select do |declared_method| actual_method = mod.instance_method(declared_method.name) # Note that in the case where an abstract method is overridden by another abstract method, # this method will return them both. This is intentional to ensure we validate the final # implementation against all declarations of an abstract method (they might not all have the # same signature). abstract_method?(actual_method) end end