Class: TortoiseLabs::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/tortoiselabs/vps.rb

Overview

Jobs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job) ⇒ Job

Returns a new instance of Job.



26
27
28
29
30
31
# File 'lib/tortoiselabs/vps.rb', line 26

def initialize(job)
  @id, @method, @entry_ts, @start_ts = job["id"], job["req_env"]["method"],
    job["entry_ts"], job["start_ts"]
    
  @success = job["rsp_env"]["params"]["success"]
end

Instance Attribute Details

#entry_tsObject (readonly)

Returns the value of attribute entry_ts.



24
25
26
# File 'lib/tortoiselabs/vps.rb', line 24

def entry_ts
  @entry_ts
end

#idObject (readonly)

Returns the value of attribute id.



24
25
26
# File 'lib/tortoiselabs/vps.rb', line 24

def id
  @id
end

#methodObject (readonly)

Returns the value of attribute method.



24
25
26
# File 'lib/tortoiselabs/vps.rb', line 24

def method
  @method
end

#start_tsObject (readonly)

Returns the value of attribute start_ts.



24
25
26
# File 'lib/tortoiselabs/vps.rb', line 24

def start_ts
  @start_ts
end

#successObject (readonly)

Returns the value of attribute success.



24
25
26
# File 'lib/tortoiselabs/vps.rb', line 24

def success
  @success
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/tortoiselabs/vps.rb', line 37

def success?
  @success
end

#to_sObject



33
34
35
# File 'lib/tortoiselabs/vps.rb', line 33

def to_s
  "Job #{@id}: #{@method}"
end