| Module | ActiveResource::CustomMethods |
| In: |
activeresource/lib/active_resource/custom_methods.rb
|
| delete | -> | orig_delete |
Need to jump through some hoops to retain the original class ‘delete’ method
# File activeresource/lib/active_resource/custom_methods.rb, line 54 def delete(custom_method_name, options = {}) if (custom_method_name.is_a?(Symbol)) connection.delete(custom_method_collection_url(custom_method_name, options), headers) else orig_delete(custom_method_name, options) end end
# File activeresource/lib/active_resource/custom_methods.rb, line 41 def get(method_name, options = {}) connection.get(custom_method_collection_url(method_name, options), headers) end
# File activeresource/lib/active_resource/custom_methods.rb, line 34 def self.included(within) within.class_eval do class << self include ActiveResource::CustomMethods::ClassMethods alias :orig_delete :delete def get(method_name, options = {}) connection.get(custom_method_collection_url(method_name, options), headers) end def post(method_name, options = {}, body = '') connection.post(custom_method_collection_url(method_name, options), body, headers) end def put(method_name, options = {}, body = '') connection.put(custom_method_collection_url(method_name, options), body, headers) end # Need to jump through some hoops to retain the original class 'delete' method def delete(custom_method_name, options = {}) if (custom_method_name.is_a?(Symbol)) connection.delete(custom_method_collection_url(custom_method_name, options), headers) else orig_delete(custom_method_name, options) end end end end within.send(:include, ActiveResource::CustomMethods::InstanceMethods) end
# File activeresource/lib/active_resource/custom_methods.rb, line 45 def post(method_name, options = {}, body = '') connection.post(custom_method_collection_url(method_name, options), body, headers) end