Finbarr
Finbarr

Reputation: 32206

Is it possible to include modules in other modules in Ruby?

Is it possible to include modules in other modules in Ruby?

Upvotes: 0

Views: 98

Answers (2)

Dave Newton
Dave Newton

Reputation: 160321

Yes.

That said, the whole double-inclusion thing can be bad. There's a gem for that.

Upvotes: 3

sheldonh
sheldonh

Reputation: 2724

Sure, but...

Before you do that, ask yourself what distinction caused you to split the code across two modules, and then ask why that distinction wouldn't be meaningful to your consumers.

Upvotes: 3

Related Questions