Sha256: 211ec2d3c95ce2b7bda2621b067b21153dc2abf43178eb2d9435e7cc9788226f

Contents?: true

Size: 682 Bytes

Versions: 5

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

module Panoptes
  class Client
    module Workflows
      def workflow(workflow_id)
        response = panoptes.get("/workflows/#{workflow_id}")
        response.fetch('workflows').find do |i|
          i.fetch('id').to_s == workflow_id.to_s
        end
      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

5 entries across 5 versions & 1 rubygems

Version Path
panoptes-client-1.2.1 lib/panoptes/client/workflows.rb
panoptes-client-1.2.0 lib/panoptes/client/workflows.rb
panoptes-client-1.1.1 lib/panoptes/client/workflows.rb
panoptes-client-1.1.0 lib/panoptes/client/workflows.rb
panoptes-client-1.0.0 lib/panoptes/client/workflows.rb