# File lib/sinatra/rabbit.rb, line 305
      def generate
        operations.values.reject { |op| op.member }.each { |o| o.generate }
        operations.values.select { |op| op.member }.each { |o| o.generate }
        app = ::Sinatra::Application
        collname = name # Work around Ruby's weird scoping/capture
        app.send(:define_method, "#{name.to_s.singularize}_url") do |id|
          api_url_for "#{collname}/#{id}", :full
        end
        if index_op = operations[:index]
          app.send(:define_method, "#{name}_url") do
            api_url_for index_op.path.gsub(/\/\?$/,''), :full
          end
        end
      end