In Ruby, what is the equivalent to an interface in C#?

后端 未结 6 1033
轮回少年
轮回少年 2021-01-01 12:31

I\'m currently trying to learn Ruby and I\'m trying to understand more about what it offers in terms of encapsulation and contracts.

In C# a contract can be defined

6条回答
  •  旧时难觅i
    2021-01-01 12:50

    Ruby doesn't really have them; interfaces and contracts generally live more in the static world, rather than the dynamic.

    There is a gem called Handshake that can implement informal contracts, if you really need it.

提交回复
热议问题