Module ActiveResource::CustomMethods
In: activeresource/lib/active_resource/custom_methods.rb

Methods

delete   get   included   post   put  

Included Modules

ActiveResource::CustomMethods::ClassMethods

Classes and Modules

Module ActiveResource::CustomMethods::ClassMethods
Module ActiveResource::CustomMethods::InstanceMethods

External Aliases

delete -> orig_delete

Public Class methods

Need to jump through some hoops to retain the original class ‘delete’ method

[Source]

# 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

[Source]

# 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

[Source]

# 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

[Source]

# 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

[Source]

# File activeresource/lib/active_resource/custom_methods.rb, line 49
          def put(method_name, options = {}, body = '')
            connection.put(custom_method_collection_url(method_name, options), body, headers)
          end

[Validate]