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
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