def stack_push(o)

      return stack_push(o.to_lua) if o.respond_to?(:to_lua)

      case o

      when NilClass then Lib.lua_pushnil(@pointer)

      when TrueClass then Lib.lua_pushboolean(@pointer, 1)
      when FalseClass then Lib.lua_pushboolean(@pointer, 0)

      when Integer then Lib.lua_pushinteger(@pointer, o)
      when Float then Lib.lua_pushnumber(@pointer, o)

      when String then Lib.lua_pushlstring(@pointer, o, o.bytesize)
      when Symbol then Lib.lua_pushlstring(@pointer, o.to_s, o.to_s.bytesize)

      when Hash then stack_push_hash(o)
      when Array then stack_push_array(o)

      else raise(
        ArgumentError.new(
          "don't know how to pass Ruby instance of #{o.class} to Lua"))
      end
    end
def stack_push(o)

      return stack_push(o.to_lua) if o.respond_to?(:to_lua)

      case o

      when NilClass then Lib.lua_pushnil(@pointer)

      when TrueClass then Lib.lua_pushboolean(@pointer, 1)
      when FalseClass then Lib.lua_pushboolean(@pointer, 0)

      when Integer then Lib.lua_pushinteger(@pointer, o)
      when Float then Lib.lua_pushnumber(@pointer, o)

      when String then Lib.lua_pushlstring(@pointer, o, o.bytesize)
      when Symbol then Lib.lua_pushlstring(@pointer, o.to_s, o.to_s.bytesize)

      when Hash then stack_push_hash(o)
      when Array then stack_push_array(o)

      else raise(
        ArgumentError.new(
          "don't know how to pass Ruby instance of #{o.class} to Lua"))
      end
    end
Given a Ruby instance, will attempt to push it on the Lua stack.