Method: PyBossa::Task.create

Defined in:
lib/pybossa-api/task.rb

.create(opts = {}) ⇒ Hash

Creates a task.

Parameters:

  • opts (Hash) (defaults to: {})

    optional arguments

Options Hash (opts):

  • :app_id (Integer)

    the app ID to which this object belongs

  • :state (String)

    one of:

    • "all": Default state
    • "in_progress": A user is running the task
    • "pending": The task is completed but requires validation
    • "valid": The task is completed and valid
    • "invalid": The task is completed and invalid
    • "error": The task has an error
  • :quorum (Integer)

    number of users who should do this task [not in use]

  • :calibration (Boolean)

    whether this is a calibration task [not in use]

  • :priority_0 (Float)

    between 0 (low) and 1 (high) [not in use]

  • :info (Hash)

    all other task details

  • :api_key (String)

    an API key

Returns:

  • (Hash)

    a task

See Also:



39
40
41
42
43
44
# File 'lib/pybossa-api/task.rb', line 39

def create(opts = {})
  if opts.has_key? :calibration
    opts[:calibration] = opts[:calibration] ? 1 : 0
  end
  PyBossa::API.create 'task', opts
end