title: Accessing Sinatra scope from another class
body: <p>I'm running a Sinatra application with a few extra classes pulled in for creating a User and a few others on the fly (no DB, it feeds in from a web service). I'm trying send out a flash notice (using <a href="https://github.com/nakajima/rack-flash" rel="nofollow">https://github.com/nakajima/rack-flash</a>) from within my User model but can't figure out how to get access to the flash method/variable because I'm out of scope.</p>
  
  <p>Something like:</p>
  
  <pre>
  class User
    def something
      if true
        flash[:notice] = 'Good job'
      else
        # nope
      end
    end
  end
  </pre>
  
  <p>Which gets required into the Sinatra app by a simple <code>require 'models/user'</code></p>