ruby / 3.1 / net / writeadapter.html

class Net::WriteAdapter

Parent:
Object

The writer adapter class

Public Class Methods

new(writer) Show source
# File lib/net/protocol.rb, line 450
def initialize(writer)
  @writer = writer
end

Public Instance Methods

<<(str) Show source
# File lib/net/protocol.rb, line 464
def <<(str)
  write str
  self
end
inspect() Show source
# File lib/net/protocol.rb, line 454
def inspect
  "#<#{self.class} writer=#{@writer.inspect}>"
end
print(str)
Alias for: write
printf(*args) Show source
# File lib/net/protocol.rb, line 473
def printf(*args)
  write sprintf(*args)
end
puts(str = '') Show source
# File lib/net/protocol.rb, line 469
def puts(str = '')
  write str.chomp("\n") + "\n"
end
write(str) Show source
# File lib/net/protocol.rb, line 458
def write(str)
  @writer.call(str)
end
Also aliased as: print

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