server/lib/sinatra/rabbit.rb
# Add a new operation for this collection. For the standard REST
# operations :index, :show, :update, and :destroy, we already know
# what method to use and whether this is an operation on the URL for
# individual elements or for the whole collection.
#
# For non-standard operations, options must be passed:
#  :method : one of the HTTP methods
#  :member : whether this is an operation on the collection or an
#            individual element (FIXME: custom operations on the
#            collection will use a nonsensical URL) The URL for the
#            operation is the element URL with the name of the operation
#            appended
#
# This also defines a helper method like show_instance_url that returns
# the URL to this operation (in request context)
Add a new operation for this collection. For the standard REST
operations :index, :show, :update, and :destroy, we already know
what method to use and whether this is an operation on the URL for
individual elements or for the whole collection.



This also defines a helper method like show_instance_url that returns
the URL to this operation (in request context)
Add a new operation for this collection . For the standard REST operations : index : show : update and : destroy we already know what method to use and whether this is an operation on the URL for individual elements or for the whole collection . This also defines a helper method like show_instance_url that returns the URL to this operation ( in request context )
def operation(name, opts = {}, &block)
        if @operations.keys.include?(name)
          raise DuplicateOperationException::new(500, "DuplicateOperation", "Operation #{name} is already defined", [])
        end
        @operations[name] = Operation.new(self, name, opts, &block)
      end
def operation ( name , opts = { } , & block ) if @operations . keys . include? ( name ) raise DuplicateOperationException :: new ( 500 , "DuplicateOperation" , "Operation #{name} is already defined" , [ ] ) end @operations [ name ] = Operation . new ( self , name , opts , & block ) end
Add a new operation for this collection.
Add a new operation for this collection .
name
opts
block