class Net::WriteAdapter
- Parent:
- Object
def initialize(socket, method)
@socket = socket
@method_id = method
end
def <<(str)
write str
self
end
def inspect
"#<#{self.class} socket=#{@socket.inspect}>"
end
def printf(*args)
write sprintf(*args)
end
def puts(str = '')
write str.chomp("\n") + "\n"
end
def write(str)
@socket.__send__(@method_id, str)
end
Ruby Core © 1993–2020 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.