title: Undefined method 'to_h' on Ruby array
body: <p>As per <a href="http://ruby-doc.org/core-2.2.0/Array.html#method-i-to_h" rel="noreferrer">Ruby Array documentation</a>, there is a method <code>to_h</code> which can be used to convert arrays to hash as long as each element of the array is another array of two elements.  Example below from the same documentation</p>
  
  <pre><code>p [[:foo, :bar], [1, 2]].to_h
  </code></pre>
  
  <p>However, when I run the above code, I get this error:</p>
  
  <pre><code>irb(main):001:0&gt; p [[:foo, :bar], [1, 2]].to_h
  NoMethodError: undefined method `to_h' for [[:foo, :bar], [1, 2]]:Array
          from (irb):1
          from E:/RubyInstall/bin/irb:12:in `&lt;main&gt;'
  irb(main):002:0&gt;
  </code></pre>
  
  <p>My Ruby version is</p>
  
  <pre><code>C:\&gt;ruby -v
  ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
  </code></pre>
  
  <p>I wanted to use this technique to answer another question on Stackoverflow, but I am stuck now as a documented feature of Ruby is not working for me.</p>