title: How do you access an instance variable within a mixin method?
body: <p>How do you access an instance variable within a mixin method? I can think of 2 ways, but both seem problematic.</p>
  
  <ol>
  <li><p>Have the mixin method access the instance variable directly as any class method would, e.g self.text. Problem with this is that it places restrictions on where the mixin method can be used, and forces the class doing the mixing to have a particular instance method named in a particular way.</p></li>
  <li><p>Pass the instance variable as a parameter to the mixin method, which would result in code like this:</p></li>
  </ol>
  
  <p>example</p>
  
  <pre><code>self.do_something(self.text)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>@thing.do_something(@thing.text)
  </code></pre>
  
  <p>which looks nasty to me, and doesn't conform to the principles of object orientation.</p>
  
  <p>Is there any other way to do it?, am I right to be concerned?</p>