class HTTPX::ProcIO

  1. lib/httpx/request/body.rb
Superclass: Object

Wrapper yielder which can be used with functions which expect an IO writer.

Methods

Public Class

  1. new

Public Instance

  1. write

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