Class: Asana::Resources::Job

Inherits:
Resource show all
Defined in:
lib/asana/resources/job.rb

Overview

A job represents a process that handles asynchronous work.

Jobs are created when an endpoint requests an action that will be handled asynchronously. Such as project or task duplication.

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Resource

inherited, #initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s

Methods included from ResponseHelper

#parse

Constructor Details

This class inherits a constructor from Asana::Resources::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Asana::Resources::Resource

Instance Attribute Details

#gidObject (readonly)



13
14
15
# File 'lib/asana/resources/job.rb', line 13

def gid
  @gid
end

#new_projectObject (readonly)



21
22
23
# File 'lib/asana/resources/job.rb', line 21

def new_project
  @new_project
end

#new_taskObject (readonly)



23
24
25
# File 'lib/asana/resources/job.rb', line 23

def new_task
  @new_task
end

#resource_subtypeObject (readonly)



17
18
19
# File 'lib/asana/resources/job.rb', line 17

def resource_subtype
  @resource_subtype
end

#resource_typeObject (readonly)



15
16
17
# File 'lib/asana/resources/job.rb', line 15

def resource_type
  @resource_type
end

#statusObject (readonly)



19
20
21
# File 'lib/asana/resources/job.rb', line 19

def status
  @status
end

Class Method Details

.find_by_id(client, id, options: {}) ⇒ Object

Returns the complete job record for a single job.

Parameters:

  • id (Gid)

    The job to get.

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

    the request I/O options.



35
36
37
38
# File 'lib/asana/resources/job.rb', line 35

def find_by_id(client, id, options: {})

  self.new(parse(client.get("/jobs/#{id}", options: options)).first, client: client)
end

.plural_nameObject

Returns the plural name of the resource.



27
28
29
# File 'lib/asana/resources/job.rb', line 27

def plural_name
  'jobs'
end