Rubify Socket and ServerSocket
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668993 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/lib/thrift/transport/socket.rb b/lib/rb/lib/thrift/transport/socket.rb
index 88fed90..5c1c4b1 100644
--- a/lib/rb/lib/thrift/transport/socket.rb
+++ b/lib/rb/lib/thrift/transport/socket.rb
@@ -30,7 +30,7 @@
end
def open?
- return !@handle.nil?
+ !@handle.nil?
end
def write(str)
@@ -50,7 +50,7 @@
if (data.length == 0)
raise TransportException.new(TransportException::UNKNOWN, "Socket: Could not read #{sz} bytes from #{@host}:#{@port}")
end
- return data
+ data
end
def close
@@ -71,17 +71,17 @@
end
def accept
- if (@handle != nil)
+ unless @handle.nil?
sock = @handle.accept
trans = Socket.new
trans.set_handle(sock)
- return trans
+ trans
end
- return nil
end
def close
@handle.close unless @handle.nil?
+ @handle = nil
end
end
deprecate_class! :TServerSocket => ServerSocket