title: How do I select a random item from an array in ruby (not rails)
body: <p>I have an array of countries:</p>
  
  <pre><code>@countries = ["Canada", "Denmark", "Germany", "Isle of Man", "Namibia", "Qatar", "South Africa",  "United Kingdom","United States"]
  </code></pre>
  
  <p>And am building some random data for testing like this:</p>
  
  <pre><code>@test = [{ :name   =&gt; "AAA -"+Faker::Name.name,  :country =&gt; @countries.???? ....}]
  </code></pre>
  
  <p>How do I get a random value from the <code>@countries</code> hash?</p>
  
  <pre><code>@countries.rand(mlen)
  </code></pre>
  
  <p>does not work and returns <code>NoMethodError: private method</code>rand' called for #`.</p>