How do I call a super class method

前端 未结 5 831
栀梦
栀梦 2020-12-24 01:44

I have two classes A, and B. Class B overrides the foo method of class A. Class B has a b

5条回答
  •  渐次进展
    2020-12-24 02:17

    In this particular case you can just alias :bar :foo before def foo in class B to rename the old foo to bar, but of course you can alias to any name you like and call it from that. This question has some alternative ways to do it further down the inheritance tree.

提交回复
热议问题