Module: HTTParty::ClassMethods
- Defined in:
- lib/mugen/httparty_extensions.rb
Instance Method Summary collapse
-
#get(path, options = {}) ⇒ Object
Inject pre GET hook.
- #original_get ⇒ Object
- #original_post ⇒ Object
- #original_put ⇒ Object
-
#post(path, options = {}) ⇒ Object
Inject pre POST hook.
-
#put(path, options = {}) ⇒ Object
Inject pre PUT hook.
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, ={}) path, = before_get(path, ) if respond_to?(:before_get) original_get(path, ) end |
#original_get ⇒ Object
3 |
# File 'lib/mugen/httparty_extensions.rb', line 3 alias :original_get :get |
#original_post ⇒ Object
4 |
# File 'lib/mugen/httparty_extensions.rb', line 4 alias :original_post :post |
#original_put ⇒ Object
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, ={}) path, = before_post(path, ) if respond_to?(:before_post) original_post(path, ) end |
#put(path, options = {}) ⇒ Object
Inject pre PUT hook
20 21 22 23 |
# File 'lib/mugen/httparty_extensions.rb', line 20 def put(path, ={}) path, = before_put(path, ) if respond_to?(:before_put) original_put(path, ) end |