I am not sure how to do this without using comparisons. However, if you delete Object.methods, you can limit the comparisons made:
def aliased?(x) (methods - Object.methods).each do |m| next if m.to_s == x.to_s return true if method(m.to_sym) == method(x.to_sym) end false end
source share