class IO::Endpoint::SocketEndpoint
This class doesn’t exert ownership over the specified socket, wraps a native ::IO.
def bind(&block)
@parameter socket [Socket] The socket.
@yields {|socket| ...} If a block is given, yields the socket.
Bind using the wrapped socket.
def bind(&block) if block_given? yield @socket else return @socket end end
def connect(&block)
@parameter socket [Socket] The socket.
@yields {|socket| ...} If a block is given, yields the socket.
Connect using the wrapped socket.
def connect(&block) if block_given? yield @socket else return @socket end end
def initialize(socket, **options)
@parameter socket [Socket] The socket to wrap.
Initialize a new socket endpoint.
def initialize(socket, **options) super(**options) @socket = socket end
def inspect
Get a detailed string representation of the socket endpoint.
def inspect "\#<#{self.class} #{@socket.inspect}>" end
def to_s
Get a string representation of the socket endpoint.
def to_s "socket:#{@socket}" end