Module | ActiveResource::CustomMethods |
In: |
vendor/rails/activeresource/lib/active_resource/custom_methods.rb
|
delete | -> | orig_delete |
Need to jump through some hoops to retain the original class ‘delete’ method
# File vendor/rails/activeresource/lib/active_resource/custom_methods.rb, line 55 55: def delete(custom_method_name, options = {}) 56: if (custom_method_name.is_a?(Symbol)) 57: connection.delete(custom_method_collection_url(custom_method_name, options), headers) 58: else 59: orig_delete(custom_method_name, options) 60: end 61: end
# File vendor/rails/activeresource/lib/active_resource/custom_methods.rb, line 42 42: def get(method_name, options = {}) 43: connection.get(custom_method_collection_url(method_name, options), headers) 44: end
# File vendor/rails/activeresource/lib/active_resource/custom_methods.rb, line 34 34: def self.included(within) 35: within.class_eval do 36: extend ActiveResource::CustomMethods::ClassMethods 37: include ActiveResource::CustomMethods::InstanceMethods 38: 39: class << self 40: alias :orig_delete :delete 41: 42: def get(method_name, options = {}) 43: connection.get(custom_method_collection_url(method_name, options), headers) 44: end 45: 46: def post(method_name, options = {}, body = '') 47: connection.post(custom_method_collection_url(method_name, options), body, headers) 48: end 49: 50: def put(method_name, options = {}, body = '') 51: connection.put(custom_method_collection_url(method_name, options), body, headers) 52: end 53: 54: # Need to jump through some hoops to retain the original class 'delete' method 55: def delete(custom_method_name, options = {}) 56: if (custom_method_name.is_a?(Symbol)) 57: connection.delete(custom_method_collection_url(custom_method_name, options), headers) 58: else 59: orig_delete(custom_method_name, options) 60: end 61: end 62: end 63: end 64: end
# File vendor/rails/activeresource/lib/active_resource/custom_methods.rb, line 46 46: def post(method_name, options = {}, body = '') 47: connection.post(custom_method_collection_url(method_name, options), body, headers) 48: end