Reputation: 11391
I am trying to write a generic module to extend the World class. I need to access the Before and After hooks from within the module. I am doing this by using the extended method but Before/After does not seem to be available at this point.
module MyWorld
def MyWorld.extended(obj)
obj.Before do
# this doesn't work
end
end
end
Is there another way to access these hooks?
Upvotes: 1
Views: 889
Reputation: 11391
Found out how to do it:
module MyWorld
def MyWorld.extended(obj)
Main.Before do
# some stuff
end
Main.After do
# some other stuff
end
end
end
Upvotes: 1