module T::AbstractUtils

def self.declared_abstract_methods_for(mod)

regardless of whether they have been implemented.
Given a module, returns the set of methods declared as abstract (in itself or ancestors)
def self.declared_abstract_methods_for(mod)
  methods = []
  mod.ancestors.each do |ancestor|
    ancestor_methods = ancestor.private_instance_methods(false) + ancestor.instance_methods(false)
    ancestor_methods.each do |method_name|
      method = ancestor.instance_method(method_name)
      methods << method if abstract_method?(method)
    end
  end
  methods
end