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 148 def initialize(block) 149 @block = block 150 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 153 def write(data) 154 @block.call(data.dup) 155 data.bytesize 156 end