A
ara.t.howard
this suprised me today:
harp:~ > cat a.rb
class A
def assertion
raise NotImplementedError
end
alias_method "assertion?", "assertion"
end
class B < A
def assertion
true
end
end
B::new.assertion?
harp:~ > ruby a.rb
a.rb:3:in `assertion?': NotImplementedError (NotImplementedError)
from a.rb:14
this only way i can seem to make this work is through some self::inherited
hacks or to actually define assertion? in the base class. is there no clean
way to inherit aliases?
regards.
-a
harp:~ > cat a.rb
class A
def assertion
raise NotImplementedError
end
alias_method "assertion?", "assertion"
end
class B < A
def assertion
true
end
end
B::new.assertion?
harp:~ > ruby a.rb
a.rb:3:in `assertion?': NotImplementedError (NotImplementedError)
from a.rb:14
this only way i can seem to make this work is through some self::inherited
hacks or to actually define assertion? in the base class. is there no clean
way to inherit aliases?
regards.
-a