Module: Faraday::Adapter::HTTPX::OnDataPlugin::ResponseBodyMethods

Defined in:
lib/httpx/adapters/faraday.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#on_data=(value) ⇒ Object (writeonly)

Sets the attribute on_data

Parameters:

  • value

    the value to set the attribute on_data to.



132
133
134
# File 'lib/httpx/adapters/faraday.rb', line 132

def on_data=(value)
  @on_data = value
end

Instance Method Details

#write(chunk) ⇒ Object



134
135
136
137
138
# File 'lib/httpx/adapters/faraday.rb', line 134

def write(chunk)
  return super unless @on_data

  @on_data.call(chunk, chunk.bytesize)
end