The writer adapter class
# File lib/net/protocol.rb, line 450 def initialize(socket, method) @socket = socket @method_id = method end
# File lib/net/protocol.rb, line 465 def <<(str) write str self end
# File lib/net/protocol.rb, line 455 def inspect "#<#{self.class} socket=#{@socket.inspect}>" end
# File lib/net/protocol.rb, line 474 def printf(*args) write sprintf(*args) end
# File lib/net/protocol.rb, line 470 def puts(str = '') write str.chomp("\n") + "\n" end
# File lib/net/protocol.rb, line 459 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.