In Files

  • ruby-3.1.2/lib/net/protocol.rb

Files

Class/Module Index [+]

Quicksearch

Net::WriteAdapter

The writer adapter class

Public Class Methods

new(writer) click to toggle source
 
               # File ruby-3.1.2/lib/net/protocol.rb, line 450
def initialize(writer)
  @writer = writer
end
            

Public Instance Methods

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