title: How do you access the 'request' object (or similar) from custom classes?
body: <p>Within my Rails 5 app, I have a custom classes inside <code>app/services</code> and I need access to the current subdomain.  </p>
  
  <p>Right now, the individual methods may look like this:</p>
  
  <pre><code>...
  def self.is_valid? req
    blacklist.exclude? req.subdomain
  end
  </code></pre>
  
  <p>But this means I need to pass in <code>request</code> each time.  This isn't optimal, so I'm wondering how you would access the rails <code>request</code> object from within the class.</p>