Is there a hook similar to Class#inherited that's triggered only after a Ruby class definition? -
#infeared after the class Foo statement is called It should do something that will run only after the end statement which closes the class declaration.
For example, what do I need:
Class inherited class DRF puts "End and Class Fu in #inherited for end # # {M}" Fu "finally puts" I really wanted to be sporadic here. " ### Output: #In Infrared FU #FU # # I really wanted to have triggered here. Is there anything like that? Can it be made? Am I completely out of luck?
You can be out of luck but this is only a warning, not a definite answer.
Ruby has begun to begin the definition of class, instead of the end, class # inherited b / c ruby class definitions is not a real end Can be re-opened at any time.
It was there, but it has not gone yet. :
I'm not going to implement every possible hook, so when someone comes up with more concrete use, then I'll consider it again.
const_addedwill, notclass_added.
Then it handled your case - but I'm not sure (this may trigger in the beginning, even when it was finally implemented).
What are you trying to do with this trigger? There may be another way to do this.
Comments
Post a Comment