title: Ruby class key based on other keys
body: <p>I have the following ruby class:</p>
  
  <pre><code>class Question
  key :id, String
  key :data, String, :default =&gt; "", :required =&gt; true
  </code></pre>
  
  <p>I would like to add another key that is based off of id and title (specifically "#{id} #{data}"). Is there an easy way to do this.</p>
  
  <p>The reason I need this is because I am using mongo map slugizer which wants the name of a key to slugize (its code calls <code>slugize(self[key_provided]))</code> I am trying to figure out how to use it to slugize the id + data together without having to change its code.  Any ideas?</p>
  
  <p>Edit:
  I am using slugizer from mongomapper_ext. you can see from the following example: <a href="https://github.com/dcu/mongomapper_ext/blob/master/examples/slugizer.rb" rel="nofollow">https://github.com/dcu/mongomapper_ext/blob/master/examples/slugizer.rb</a> </p>
  
  <p>that slug_key is passed the name of one of the keys in which to slugize. i would like to define two keys to slugize together, without having to change their code. Thanks!</p>