Module: Typhoeus::EasyFu::Callbacks
- Included in:
- Typhoeus::Easy
- Defined in:
- lib/typhoeus/easy/callbacks.rb
Instance Method Summary collapse
-
#failure ⇒ Object
gets called when finished and response code is 300-599 or curl returns an error code.
- #on_failure(&block) ⇒ Object
- #on_failure=(block) ⇒ Object
- #on_success(&block) ⇒ Object
- #on_success=(block) ⇒ Object
-
#success ⇒ Object
gets called when finished and response code is not 2xx, or curl returns an error code.
Instance Method Details
#failure ⇒ Object
gets called when finished and response code is 300-599 or curl returns an error code
20 21 22 |
# File 'lib/typhoeus/easy/callbacks.rb', line 20 def failure @failure.call(self) if @failure end |
#on_failure(&block) ⇒ Object
24 25 26 |
# File 'lib/typhoeus/easy/callbacks.rb', line 24 def on_failure(&block) @failure = block end |
#on_failure=(block) ⇒ Object
28 29 30 |
# File 'lib/typhoeus/easy/callbacks.rb', line 28 def on_failure=(block) @failure = block end |
#on_success(&block) ⇒ Object
10 11 12 |
# File 'lib/typhoeus/easy/callbacks.rb', line 10 def on_success(&block) @success = block end |
#on_success=(block) ⇒ Object
14 15 16 |
# File 'lib/typhoeus/easy/callbacks.rb', line 14 def on_success=(block) @success = block end |
#success ⇒ Object
gets called when finished and response code is not 2xx, or curl returns an error code.
6 7 8 |
# File 'lib/typhoeus/easy/callbacks.rb', line 6 def success @success.call(self) if @success end |