Where to place private methods in Ruby?

前端 未结 10 1020
故里飘歌
故里飘歌 2021-01-30 00:50

Most of the blogs or tutorials or books have private methods at the bottom of any class/module. Is this the best practice?

I find having private methods as and when nece

10条回答
  •  遇见更好的自我
    2021-01-30 01:27

    I think that public methods is a some kind of interface of the object, and it's logical to place them on the most prominent place i.e. in the top of file.

提交回复
热议问题