I can't work out from looking through the source what the difference is between the cattr_*
and mattr_*
methods provided in Class and Module respectively. I read this question: http://stackoverflow.com/questions/185573/what-is-mattr-accessor-in-a-rails-module which gives some details about both methods but doesn't highlight the differences.
So my question is what is the difference between them and why do we need both sets of methods when they are practically identical in the source? Also, which should we use when?