module Oria class Client < EventMachine::Connection attr_reader :response def connection_completed @connected = true end def receive_data(data) @response = JSON.parse(data) close_connection end def unbind raise Oria::ConnectionError.new("Could not connect to the Oria server") unless @connected EventMachine.stop_event_loop end end end