Module: Typhoeus::EasyFu::Callbacks

Included in:
Typhoeus::Easy
Defined in:
lib/typhoeus/easy/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#failureObject

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

#successObject

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