title: make hash consistent when some of its keys are symbols and others are not
body: <p>I use this code to merge a Matchdata with a Hash :</p>
  
  <pre><code>  params = {
      :url =&gt; 'http://myradiowebsite.com/thestation'
    }
  
    pattern = Regexp.new('^https?://(?:www.)?myradiowebsite.com/(?&lt;station_slug&gt;[^/]+)/?$')
    matchdatas = pattern.match(params[:url])
    #convert named matches in MatchData to Hash
    #https://stackoverflow.com/a/11690565/782013
    datas = Hash[ matchdatas.names.zip( matchdatas.captures ) ]
  
    params = params.merge(datas)
  </code></pre>
  
  <p>But this gives me mixed keys in my <em>params</em> hash:</p>
  
  <blockquote>
    <p>{:url=>"<a href="http://myradiowebsite.com/thestation" rel="nofollow noreferrer">http://myradiowebsite.com/thestation</a>", "station_slug"=>"thestation"}</p>
  </blockquote>
  
  <p>Which is a problem to get the hash values using the keys later.  I would like to standardize them to symbols.</p>
  
  <p>I'm learning Ruby, can someone explain me if there is something wrong with this code, and how to improve it ?</p>
  
  <p>Thanks !</p>