Class: Asana::Resources::Job

Inherits:
JobsBase 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 JobsBase

get_job, inherited

Methods inherited from Resource

#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)


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

def gid
  @gid
end

#new_projectObject (readonly)


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

def new_project
  @new_project
end

#new_taskObject (readonly)


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

def new_task
  @new_task
end

#resource_subtypeObject (readonly)


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

def resource_subtype
  @resource_subtype
end

#resource_typeObject (readonly)


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

def resource_type
  @resource_type
end

#statusObject (readonly)


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

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.


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

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.


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

def plural_name
  'jobs'
end