Class: GLPL::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/glpl/job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_data) ⇒ Job

Returns a new instance of Job.



7
8
9
10
11
12
13
14
15
# File 'lib/glpl/job.rb', line 7

def initialize(job_data)
  @id         = job_data["id"]
  @status     = job_data["status"]
  @stage      = job_data["stage"]
  @name       = job_data["name"]
  @ref        = job_data["ref"]
  @created_at = DateTime.parse(job_data["created_at"])
  @username   = job_data["username"]
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#refObject (readonly)

Returns the value of attribute ref.



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

def ref
  @ref
end

#stageObject (readonly)

Returns the value of attribute stage.



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

def stage
  @stage
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#usernameObject (readonly)

Returns the value of attribute username.



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

def username
  @username
end