The writer adapter class
Source: show | on GitHub
# File ruby/lib/net/protocol.rb, line 487 def initialize(writer) @writer = writer end
# File ruby/lib/net/protocol.rb, line 501 def <<(str) write str self end
# File ruby/lib/net/protocol.rb, line 491 def inspect "#<#{self.class} writer=#{@writer.inspect}>" end
# File ruby/lib/net/protocol.rb, line 510 def printf(*args) write sprintf(*args) end
# File ruby/lib/net/protocol.rb, line 506 def puts(str = '') write str.chomp("\n") + "\n" end
# File ruby/lib/net/protocol.rb, line 495 def write(str) @writer.call(str) end