def to_a(pure=true)

      h = self.to_h

      pure && h.keys.find { |k| not [ Float ].include?(k.class) } &&
        fail('cannot turn hash into array, some keys are not numbers')

      a_keys = (1..objlen).to_a.collect { |k| k.to_f }
      keys = a_keys + (h.keys - a_keys)

      keys.inject([]) { |a, k|
        a << (a_keys.include?(k) ? h[k] : [ k, h[k] ])
        a
      }
    end
def to_a(pure=true)

      h = self.to_h

      pure && h.keys.find { |k| not [ Float ].include?(k.class) } &&
        fail('cannot turn hash into array, some keys are not numbers')

      a_keys = (1..objlen).to_a.collect { |k| k.to_f }
      keys = a_keys + (h.keys - a_keys)

      keys.inject([]) { |a, k|
        a << (a_keys.include?(k) ? h[k] : [ k, h[k] ])
        a
      }
    end
Returns a Ruby Array instance representing this Lua table.

 Will raise an error if the 'rendering' is not possible.

   s = Rufus::Lua::State.new

   @s.eval("return { a = 'A', b = 'B', c = 3 }").to_a
     # => error !

   @s.eval("return { 1, 2 }").to_a
     # => [ 1.0, 2.0 ]

   @s.eval("return {}").to_a
     # => []

   @s.eval("return { 1, 2, car = 'benz' }").to_a
     # => error !

 == to_a(false)

 Setting the optional argument 'pure' to false will manage any table :

   s = Rufus::Lua::State.new

   @s.eval("return { a = 'A', b = 'B', c = 3 }").to_a(false)
     # => [["a", "A"], ["b", "B"], ["c", 3.0]]

   @s.eval("return { 1, 2 }").to_a(false)
     # => [1.0, 2.0]

   @s.eval("return {}").to_a(false)
     # => []

   @s.eval("return { 1, 2, car = 'benz' }").to_a(false)
     # => [1.0, 2.0, ["car", "benz"]]