title: Flask-RESTful how to add_resource and pass it non-global data
body: <p>In the <strong><a href="http://flask-restful.readthedocs.org/en/latest/" rel="noreferrer">Flask-RESTful</a></strong> example application <strong><a href="http://flask-restful.readthedocs.org/en/latest/quickstart.html#full-example" rel="noreferrer">posted here</a></strong>, the <code>TODOS</code> collection is a global variable.</p>
  
  <p>After the <code>Todo</code> <strong>Resource</strong> is registered:</p>
  
  <pre><code>api.add_resource(Todo, '/todos/&lt;string:todo_id&gt;')
  </code></pre>
  
  <p>The <code>Todo</code> methods access the global <code>TODOS</code> variable when web requests are processed. </p>
  
  <p>Instead, I want to instantiate the API within a class and pass a <code>TODOS</code> collection that is a class variable rather than a global variable. </p>
  
  <p>When using <strong>Flask-RESTful</strong>, what is the proper way to allow methods in a <strong>Resource</strong> class to gain access to a variable provided by the calling class without using global variables?</p>