title: Converting hash to string in Ruby
body: <p>Let's say we have a hash:</p>
  
  <pre><code>flash = {}
  flash[:error] = "This is an error."
  flash[:info] = "This is an information."
  </code></pre>
  
  <p>I would like to convert it to a string:</p>
  
  <pre><code>"&lt;div class='error'&gt;This is an error.&lt;/div&gt;&lt;div class='info'&gt;This is an information".
  </code></pre>
  
  <p>in nice one liner ;)</p>
  
  <p>I found something like that:</p>
  
  <pre><code>flash.to_a.collect{|item| "&lt;div class='#{item[0]}'&gt;#{item[1]}&lt;/div&gt;"}.join
  </code></pre>
  
  <p>That solves my problem but maybe there is nicer solution built in hashtable class?</p>