title: How can you call class methods on mailers when they're not defined as such?
body: <p>When sending mail in Rails, usually one would do something like this:</p>
  
  <pre><code>UserMailer.password_reset(user).deliver
  </code></pre>
  
  <p>But if we look inside <code>UserMailer</code> we can see this:</p>
  
  <pre><code>def password_reset(user) # not self.password_reset
    # ...
  end
  </code></pre>
  
  <p>Notice that the method name is not prefixed with <code>self</code>. Looking at it, it seems like you need to instantiate the object first as below. How does Rails do this?</p>
  
  <pre><code>UserMailer.new.password_reset(user).deliver
  </code></pre>