I'm not a guru, but the following works for me, though it is not very
elegant:
class A
def self.method_a
puts "A"
end
end
class A
@@old_method_a = self.method(:method_a)
def self.method_a
puts "B"
@@old_method_a.call
end
end
A.method_a # outputs "B", then "A"
- Jake McArthur
On Apr 19, 2006, at 1:47 PM, Kevin Olbrich wrote:
> Here's a quick question for the Meta-programming gurus
>
> start with
>
> class A
> def self.method_a
> puts "A"
> end
> end
>
> How would I override method_a in such a way that the original method_a
> could be called at the end? sort of like that way you can call 'super'
> from a subclass.
>
>
> _Kevin
> --
> Posted with http://DevLists.com. Sign up and save your mailbox.
>