Class: Dynectastic::Job

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

Instance Attribute Summary collapse

Attributes inherited from Resource

#factory, #last_request, #session

Instance Method Summary collapse

Methods inherited from Resource

#attributes=, #delete, #get, #post, #put

Constructor Details

#initialize(request) ⇒ Job

Returns a new instance of Job.



7
8
9
10
11
# File 'lib/dynectastic/job.rb', line 7

def initialize(request)
  @request    = request
  @id         = request.job_id
  @incomplete = request.job_incomplete
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/dynectastic/job.rb', line 5

def id
  @id
end

#incompleteObject (readonly)

Returns the value of attribute incomplete.



5
6
7
# File 'lib/dynectastic/job.rb', line 5

def incomplete
  @incomplete
end

#requestObject (readonly)

Returns the value of attribute request.



5
6
7
# File 'lib/dynectastic/job.rb', line 5

def request
  @request
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


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

def complete?
  not incomplete?
end

#incomplete?Boolean

Returns:

  • (Boolean)


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

def incomplete?
  !! @incomplete
end