Module: HTTParty::ClassMethods

Defined in:
lib/mugen/httparty_extensions.rb

Instance Method Summary collapse

Instance Method Details

#get(path, options = {}) ⇒ Object

Inject pre GET hook



8
9
10
11
# File 'lib/mugen/httparty_extensions.rb', line 8

def get(path, options={})
  path, options = before_get(path, options) if respond_to?(:before_get)
  original_get(path, options)      
end

#original_getObject



3
# File 'lib/mugen/httparty_extensions.rb', line 3

alias :original_get :get

#original_postObject



4
# File 'lib/mugen/httparty_extensions.rb', line 4

alias :original_post :post

#original_putObject



5
# File 'lib/mugen/httparty_extensions.rb', line 5

alias :original_put :put

#post(path, options = {}) ⇒ Object

Inject pre POST hook



14
15
16
17
# File 'lib/mugen/httparty_extensions.rb', line 14

def post(path, options={})
  path, options = before_post(path, options) if respond_to?(:before_post)
  original_post(path, options)
end

#put(path, options = {}) ⇒ Object

Inject pre PUT hook



20
21
22
23
# File 'lib/mugen/httparty_extensions.rb', line 20

def put(path, options={})
  path, options = before_put(path, options) if respond_to?(:before_put)
  original_put(path, options)
end