title: How do I set an attr_accessor for a dynamic instance variable?
body: <p>I dynamically created an instance variable within my class:</p>
  
  <pre><code>class Mine
    attr_accessor :some_var
  
    def intialize
      @some_var = true
    end
  
    def my_number num
      self.instance_variable_set "@my_#{num}", num
    end
  end
  </code></pre>
  
  <p>How do I make <code>@my_#{num}</code> now as an attr value?</p>
  
  <p>e.g. I want to be able to do this:</p>
  
  <pre><code>dude = Mine.new
  dude.my_number 1
  dude.my_1
  =&gt; 1
  </code></pre>