1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/lib/puma/io_buffer.rb

34 lines
375 B
Ruby
Raw Normal View History

2012-08-11 18:20:38 -04:00
module Puma
class IOBuffer
def initialize
@buf = ""
end
def reset
@buf = ""
end
def <<(str)
@buf << str
end
def append(*strs)
strs.each { |s| @buf << s }
end
def to_s
@buf
end
alias_method :to_str, :to_s
def used
@buf.size
end
def capacity
@buf.size
end
end
end