Misha Moroshko Misha Moroshko - 4 months ago 11
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
end

Answer

Try following

class MyClass
  include MyModule3, MyModule2, MyModule1
end

Edit: reversed the sequence