title: Convert binary string to hexadecimal in Ruby
body: <p>What is the most efficient way to convert a binary string into hexadecimal? I'm trying to do something like this:</p>
  
  <pre><code>a = '1010'    #Binary
  </code></pre>
  
  <p>and then to become </p>
  
  <pre><code>a = 'A'       #Hexa
  </code></pre>