Class: Faraday::Adapter::HTTPX::ParallelManager::ResponseHandler

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/httpx/adapters/faraday.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ ResponseHandler

Returns a new instance of ResponseHandler.



157
158
159
160
# File 'lib/httpx/adapters/faraday.rb', line 157

def initialize(env)
  @env = env
  super
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



155
156
157
# File 'lib/httpx/adapters/faraday.rb', line 155

def env
  @env
end

Instance Method Details

#on_complete(&blk) ⇒ Object



173
174
175
176
177
178
179
180
# File 'lib/httpx/adapters/faraday.rb', line 173

def on_complete(&blk)
  if blk
    @on_complete = blk
    self
  else
    @on_complete
  end
end

#on_response(&blk) ⇒ Object



162
163
164
165
166
167
168
169
170
171
# File 'lib/httpx/adapters/faraday.rb', line 162

def on_response(&blk)
  if blk
    @on_response = ->(response) do
      blk.call(response)
    end
    self
  else
    @on_response
  end
end