Ruby 2.4

Net::InternetMessageIO::WriteAdapter

class Net::InternetMessageIO::WriteAdapter

Parent:Object

写入器适配器类

公共类方法

new(socket, method) Show source

# File lib/net/protocol.rb, line 379 def initialize(socket, method) @socket = socket @method_id = method end

公共实例方法

<<(str) Show source

# File lib/net/protocol.rb, line 394 def <<(str) write str self end

inspect() Show source

# File lib/net/protocol.rb, line 384 def inspect "#<#{self.class} socket=#{@socket.inspect}>" end

print(str)

Alias for: write

printf(*args) Show source

# File lib/net/protocol.rb, line 403 def printf(*args) write sprintf(*args) end

puts(str = '') Show source

# File lib/net/protocol.rb, line 399 def puts(str = '') write str.chomp("\n") + "\n" end

write(str) Show source

# File lib/net/protocol.rb, line 388 def write(str) @socket.__send__(@method_id, str) end

Also aliased as: print