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.



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

def initialize(env)
  @env = env
  super
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



130
131
132
# File 'lib/httpx/adapters/faraday.rb', line 130

def env
  @env
end

Instance Method Details

#on_complete(&blk) ⇒ Object



148
149
150
151
152
153
154
155
# File 'lib/httpx/adapters/faraday.rb', line 148

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

#on_response(&blk) ⇒ Object



137
138
139
140
141
142
143
144
145
146
# File 'lib/httpx/adapters/faraday.rb', line 137

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