Class: LogSimulator::SocketConnetion
- Inherits:
-
Object
- Object
- LogSimulator::SocketConnetion
- Defined in:
- lib/socket_connetion.rb
Instance Attribute Summary collapse
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
Instance Method Summary collapse
-
#initialize(host, port) ⇒ SocketConnetion
constructor
A new instance of SocketConnetion.
Constructor Details
#initialize(host, port) ⇒ SocketConnetion
Returns a new instance of SocketConnetion.
6 7 8 9 10 11 12 |
# File 'lib/socket_connetion.rb', line 6 def initialize (host,port) begin @socket = TCPSocket.new(host,port) rescue Exception => _ @socket = nil end end |
Instance Attribute Details
#socket ⇒ Object (readonly)
Returns the value of attribute socket.
5 6 7 |
# File 'lib/socket_connetion.rb', line 5 def socket @socket end |