What is the Ruby equivalent of the “this” function in Java?

后端 未结 4 2026
粉色の甜心
粉色の甜心 2021-01-13 16:36

In Java there is a \"this\" function that points to its method. Is there an equivalent in Ruby? For instance, is there:

def method
  this.method
end
<         


        
4条回答
  •  孤城傲影
    2021-01-13 17:00

    You can call self.whatever on the class you are in, is that what you are looking for?

提交回复
热议问题