title: Render an ERB template with values from a hash
body: <p>I must be overlooking something very simple here but I can't seem to figure out how to render a simple ERB template with values from a hash-map.</p>
  
  <p>I am relatively new to ruby, coming from python. I have an ERB template (not HTML), which I need rendered with context that's to be taken from a hash-map, which I receive from an external source.</p>
  
  <p>However, the documentation of ERB, states that the <code>ERB.result</code> method takes a <code>binding</code>. I learnt that they are something that hold the variable contexts in ruby (something like <code>locals()</code> and <code>globals()</code> in python, I presume?). But, I don't know how I can build a binding object out of my hash-map.</p>
  
  <p>A little (a <em>lot</em>, actually) googling gave me this: <a href="http://refactormycode.com/codes/281-given-a-hash-of-variables-render-an-erb-template" rel="noreferrer">http://refactormycode.com/codes/281-given-a-hash-of-variables-render-an-erb-template</a>, which uses some ruby metaprogramming magic that escapes me.</p>
  
  <p>So, isn't there a simple solution to this problem? Or is there a better templating engine (not tied to HTML) better suited for this? (I only chose ERB because its in the stdlib).</p>