📜  如何在 ruby 代码示例中包含多个模块

📅  最后修改于: 2022-03-11 15:04:46.009000             🧑  作者: Mango

代码示例1
class MyClass
  include MyModule1
  include MyModule2
  include MyModule3
end

The shorter way for the above code would be:
class MyClass
  include MyModule3, MyModule2, MyModule1
end

Remember always to reverse the order in the single line version, to keep the same ancestry order.