title: What is mattr_accessor in a Rails module?
body: <p>I couldn't really find this in Rails documentation but it seems like <strong>'mattr_accessor'</strong> is the <strong>Module</strong> corollary for <strong>'attr_accessor'</strong> (getter &amp; setter) in a normal Ruby <strong>class</strong>.</p>
  
  <p>Eg. in a class</p>
  
  <pre><code>class User
    attr_accessor :name
  
    def set_fullname
      @name = "#{self.first_name} #{self.last_name}"
    end
  end
  </code></pre>
  
  <p>Eg. in a module</p>
  
  <pre><code>module Authentication
    mattr_accessor :current_user
  
    def login
      @current_user = session[:user_id] || nil
    end
  end
  </code></pre>
  
  <p>This helper method is provided by <strong>ActiveSupport</strong>.</p>