Sha256: 4ada38b0ed3d47d31c7df2477c1bfd7437cccd4a65f9ba5d6e02cd3a4a1cc9f5

Contents?: true

Size: 1.48 KB

Versions: 12

Compression:

Stored size: 1.48 KB

Contents

module Cellect
  module Server
    class API
      class Sets < Grape::API
        # GET /workflows/:workflow_id
        # 
        # Returns a sample from the specified workflow
        # Accepts params
        #   limit: integer, default 5
        #   user_id: integer, optional
        #   group_id: integer, optional
        get do
          return four_oh_four unless workflow
          workflow.sample(selector_params)
        end

        # PUT /workflows/:workflow_id/add
        # 
        # Adds a subject to a workflow or updates the priority
        # Accepts params
        #   subject_id: integer
        #   group_id: integer, required if grouped
        #   priority: float, required if prioritized
        put :add do
          return four_oh_four unless workflow
          return bad_request unless valid_subject_id_update?
          return bad_request unless valid_group_id_update?
          return bad_request unless valid_priority_update?
          workflow.add(update_params)
          nil
        end

        # PUT /workflows/:workflow_id/remove
        # 
        # Removes a subject from a workflow
        # Accepts params
        #   subject_id: integer
        #   group_id: integer, required if grouped
        put :remove do
          return four_oh_four unless workflow
          return bad_request unless valid_subject_id_update?
          return bad_request unless valid_group_id_update?
          workflow.remove(update_params)
          nil
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cellect-server-3.0.2 lib/cellect/server/api/sets.rb
cellect-server-3.0.1 lib/cellect/server/api/sets.rb
cellect-server-3.0.0 lib/cellect/server/api/sets.rb
cellect-server-2.1.1 lib/cellect/server/api/sets.rb
cellect-server-2.1.0 lib/cellect/server/api/sets.rb
cellect-server-2.0.1 lib/cellect/server/api/sets.rb
cellect-server-2.0.0 lib/cellect/server/api/sets.rb
cellect-server-2.0.0.beta4 lib/cellect/server/api/sets.rb
cellect-server-2.0.0.beta3 lib/cellect/server/api/sets.rb
cellect-server-2.0.0.beta2 lib/cellect/server/api/sets.rb
cellect-server-2.0.0.beta1 lib/cellect/server/api/sets.rb
cellect-server-1.3.3 lib/cellect/server/api/sets.rb