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.



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

def on_data=(value)
  @on_data = value
end

Instance Method Details

#write(chunk) ⇒ Object



137
138
139
140
141
# File 'lib/httpx/adapters/faraday.rb', line 137

def write(chunk)
  return super unless @on_data

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