Socket-based singleton application class in Ruby