Class: Faraday::Adapter::HTTPX::ParallelManager::ResponseHandler
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Faraday::Adapter::HTTPX::ParallelManager::ResponseHandler
- Defined in:
- lib/httpx/adapters/faraday.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
-
#initialize(env) ⇒ ResponseHandler
constructor
A new instance of ResponseHandler.
- #on_complete(&blk) ⇒ Object
- #on_response(&blk) ⇒ Object
Constructor Details
#initialize(env) ⇒ ResponseHandler
Returns a new instance of ResponseHandler.
170 171 172 173 |
# File 'lib/httpx/adapters/faraday.rb', line 170 def initialize(env) @env = env super end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
168 169 170 |
# File 'lib/httpx/adapters/faraday.rb', line 168 def env @env end |
Instance Method Details
#on_complete(&blk) ⇒ Object
186 187 188 189 190 191 192 193 |
# File 'lib/httpx/adapters/faraday.rb', line 186 def on_complete(&blk) if blk @on_complete = blk self else @on_complete end end |
#on_response(&blk) ⇒ Object
175 176 177 178 179 180 181 182 183 184 |
# File 'lib/httpx/adapters/faraday.rb', line 175 def on_response(&blk) if blk @on_response = ->(response) do blk.call(response) end self else @on_response end end |