Misha Moroshko Misha Moroshko - 1 year ago 55
Ruby Question

Is it possible to include multiple modules in a single "include" statement?

Is there a shorter way to do the following?

class MyClass
include MyModule1
include MyModule2
include MyModule3

Answer Source

Try following

class MyClass
  include MyModule3, MyModule2, MyModule1

Edit: reversed the sequence