title: I have a array of arrays as in description need to convert it to formatted Hash in Ruby
body: <p>I have a file with many arrays as below:</p>
  
  <pre><code>[["default", "'drop'"],
  ["rule", "49", "action", "'accept'"],
  ["rule", "49", "description", "'This one is for'"],
  ["rule", "49", "destination", "address", "'1.2.3.4/20'"],
  ["rule", "50", "action", "'accept'"],
  ["rule", "50", "description", "'Once more'"],
  ["rule", "50", "destination", "address", "'1.2.3.5/20'"]]
  </code></pre>
  
  <p>I want a ruby code which can make it look like following:</p>
  
  <pre><code>{
    'default': 'drop',
    'rule': { 
      '49': { 
        'destination': { 
          'address': '1.2.3.4/20' 
        },
        'action': 'accept', 
        'description': 'This one is for' 
      },
      '50': {
        'destination': {
          'address': '1.2.3.5/20'
        },
        'action': 'accept',
        'description': 'Once more'
      }
    }
  }
  </code></pre>
  
  <p>I tried different approaches which is replacing and keeping only the last one or few keys are missing. Please help me in this.</p>