Method: RestClient.add_before_execution_proc

Defined in:
lib/restclient.rb

.add_before_execution_proc(&proc) ⇒ Object

Add a Proc to be called before each request in executed. The proc parameters will be the http request and the request params.

Raises:

  • (ArgumentError)
[View source]

169
170
171
172
# File 'lib/restclient.rb', line 169

def self.add_before_execution_proc &proc
  raise ArgumentError.new('block is required') unless proc
  @@before_execution_procs << proc
end