P
polypus
hi,
if i write
module M
def foo
old_foo
end
end
class X
def foo
puts X
end
def extend_yourself
alias old_foo foo
extend M
end
end
class Y < X
def foo
puts Y
end
end
x = X.new
y = Y.new
x.foo -> X
y.foo -> Y
x.extend_yourself
y.extend_yourself
x.foo -> X
y.foo -> X !!!
the behaviour i want though is
y.foo -> Y
what is the best way?
thanks many
if i write
module M
def foo
old_foo
end
end
class X
def foo
puts X
end
def extend_yourself
alias old_foo foo
extend M
end
end
class Y < X
def foo
puts Y
end
end
x = X.new
y = Y.new
x.foo -> X
y.foo -> Y
x.extend_yourself
y.extend_yourself
x.foo -> X
y.foo -> X !!!
the behaviour i want though is
y.foo -> Y
what is the best way?
thanks many