title: Ruby - insert into an array based on a percentage
body: <p>I have an object called <code>TestSubject</code> which I can use to access the following data, <code>name</code> and <code>percent</code> I want to insert the name based on the percent, into an array. so for example,</p>
  
  <p><code>arr.push(TestSubject.name)</code> based on the percentage of TestSubject, in this case its <code>puts TestSubject.percent #=&gt; 90</code></p>
  
  <p>This means that this specific name has a 90% chance of being pushed to the array. How ever I am not sure how to write that in ruby syntax.</p>
  
  <p>Any ideas?</p>