title: Dynamically defined setter methods using define_method?
body: <p>I use a lot of iterations to define convenience methods in my models, stuff like:</p>
  
  <pre><code>PET_NAMES.each do |pn|
  define_method(pn) do
  ...
  ...
  end
  </code></pre>
  
  <p>but I've never been able to dynamically define setter methods, ie:</p>
  
  <pre><code>def pet_name=(name)
  ...
  end
  </code></pre>
  
  <p>using define_method like so:</p>
  
  <pre><code>define_method("pet_name=(name)") do
  ...
  end
  </code></pre>
  
  <p>Any ideas? Thanks in advance.</p>