How can I intercept a method call in Boo?

故事扮演 提交于 2019-12-23 13:17:22

问题


Ruby has method_missing , Python has getattr. Does Boo offer something I can use to intercept method calls?


回答1:


Yes, Boo has IQuackFu.

Basically, you implement IQuackFu, which has three methods:

  • QuackGet: gets called when you get a property value
  • QuackSet gets called when you set a property value
  • QuackInvoke: gets called when you invoke a method

Here's an example.



来源:https://stackoverflow.com/questions/1147641/how-can-i-intercept-a-method-call-in-boo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!