title: Adding an instance variable to a class in Ruby
body: <p>How can I add an instance variable to a defined class at <b>runtime</b>, and later get and set its value from outside of the class?</p>
  
  <p>I'm looking for a metaprogramming solution that allows me to modify the class instance at runtime instead of modifying the source code that originally defined the class.  A few of the solutions explain how to declare instance variables in the class definitions, but that is not what I am asking about.  </p>