What's the difference between mattr_accessor and cattr_accessor in ActiveSupport?

I was reading source code of mattr_accessor and cattr_accessor in
ActiveSupport and found out that the method definitions are all most
identical. Except cattr_writer accepts a optional block.

I googled and read
That guy had the same question as me, but no one answered the question

Module is the superclass of Class, is there any possible that just
define mattr_accessor in Module and
alias_method cattr_accessor, mattr_accessor
in Class?
I think it’s more DRY right?

Can anyone help me?
Thank you!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs