How can I intercept a method call in Boo?
-
18-09-2019 - |
Question
Ruby has method_missing
, Python has getattr
. Does Boo offer something I can use to intercept method calls?
Solution
Yes, Boo has IQuackFu.
Basically, you implement IQuackFu
, which has three methods:
QuackGet
: gets called when you get a property valueQuackSet
gets called when you set a property valueQuackInvoke
: gets called when you invoke a method
Here's an example.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow