Sha256: f69438fcaf9759dbab4e2b73de48cb8ee1abf9da80f43a165cceb9191ccbd17b

Contents?: true

Size: 598 Bytes

Versions: 8

Compression:

Stored size: 598 Bytes

Contents

module Panoptes
  class Client
    module Workflows
      def workflow(workflow_id)
        response = panoptes.get("/workflows/#{workflow_id}")
        response.fetch("workflows").find {|i| i.fetch("id").to_s == workflow_id.to_s }
      end

      def create_workflow(attributes)
        response = panoptes.post("/workflows", workflows: attributes)
        response.fetch("workflows").first
      end

      def add_subject_set_to_workflow(workflow_id, subject_set_id)
        panoptes.post("/workflows/#{workflow_id}/links/subject_sets",subject_sets: subject_set_id)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
panoptes-client-1.0.0.pre1 lib/panoptes/client/workflows.rb
panoptes-client-1.0.0.pre lib/panoptes/client/workflows.rb
panoptes-client-0.4.0 lib/panoptes/client/workflows.rb
panoptes-client-0.3.8 lib/panoptes/client/workflows.rb
panoptes-client-0.3.7 lib/panoptes/client/workflows.rb
panoptes-client-0.3.6 lib/panoptes/client/workflows.rb
panoptes-client-0.3.5 lib/panoptes/client/workflows.rb
panoptes-client-0.3.4 lib/panoptes/client/workflows.rb