Module: Typhoeus::Hydra::BlockConnection Private
- Included in:
- Typhoeus::Hydra
- Defined in:
- lib/typhoeus/hydra/block_connection.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
This module handles the blocked connection request mode on the hydra side, where only stubbed requests are allowed. Connection blocking needs to be turned on:
Typhoeus.configure do |config|
config.block_connection = true
end
When trying to do real requests a NoStub error is raised.
Instance Method Summary collapse
-
#queue(request) ⇒ Object
private
Overrides queue in order to check before if block connection is turned on.
Instance Method Details
#queue(request) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Overrides queue in order to check before if block connection is turned on. If thats the case a NoStub error is raised.
26 27 28 29 30 31 32 |
# File 'lib/typhoeus/hydra/block_connection.rb', line 26 def queue(request) if request.blocked? raise Typhoeus::Errors::NoStub.new(request) else super end end |