Wrapper yielder which can be used with functions which expect an IO writer.
Public Class methods
new(block)
[show source]
# File lib/httpx/request/body.rb 144 def initialize(block) 145 @block = block 146 end
Public Instance methods
write(data)
Implementation the IO write protocol, which yield the given chunk to +@block+.
[show source]
# File lib/httpx/request/body.rb 149 def write(data) 150 @block.call(data.dup) 151 data.bytesize 152 end