title: Is there a way for Ruby accessors to return something other than the set variable?
body: <p>I want to do some checking in a writer accessor. My first idea was returning a boolean.</p>
  
  <pre><code>class MyClass
    def var=(var)
      @var = var
      # some checking
      return true
    end
  end
  
  m = MyClass.new
  retval = (m.var = 'foo')
  
  =&gt; "foo"
  </code></pre>
  
  <p>Can I set a return value in a writer accessor? If yes, how can I get this value?</p>