很久没玩ruby了,今天看源码的时候,看到extend硬是缓不过神了,Google下extend和include的区别,做个记录

在class中include module, 那么module中的方法将成为类的实例方法

在class中extend module, 那么module中的方法将成为类的类方法

相关文章:

  • 2021-10-25
  • 2021-09-22
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2022-01-04
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
相关资源
相似解决方案