Ruby self in layman terms?

前端 未结 3 553
梦毁少年i
梦毁少年i 2021-01-06 07:45

When is Ruby self refering to the Object and when is self refering to the Ruby class? Explanations with examples would be great. Not getting my head around this.

3条回答
  •  [愿得一人]
    2021-01-06 08:45

    I could try to explain it myself, but I think Yehuda Katz does a better job than I would do:

    Metaprogramming in Ruby: It’s All About the Self

提交回复
热议问题