class Net::WriteAdapter

Parent:
Object

The writer adapter class

Public Class Methods

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

Public Instance Methods

<<(str) Show source
# File lib/net/protocol.rb, line 398
def <<(str)
  write str
  self
end
inspect() Show source
# File lib/net/protocol.rb, line 388
def inspect
  "#<#{self.class} socket=#{@socket.inspect}>"
end
print(str)
Alias for: write
printf(*args) Show source
# File lib/net/protocol.rb, line 407
def printf(*args)
  write sprintf(*args)
end
puts(str = '') Show source
# File lib/net/protocol.rb, line 403
def puts(str = '')
  write str.chomp("\n") + "\n"
end
write(str) Show source
# File lib/net/protocol.rb, line 392
def write(str)
  @socket.__send__(@method_id, str)
end
Also aliased as: print

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.