Class: Semaph::Model::JobCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/semaph/model/job_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pipeline) ⇒ JobCollection

Returns a new instance of JobCollection.



9
10
11
# File 'lib/semaph/model/job_collection.rb', line 9

def initialize(pipeline)
  @pipeline = pipeline
end

Instance Attribute Details

#allObject (readonly)

Returns the value of attribute all.



7
8
9
# File 'lib/semaph/model/job_collection.rb', line 7

def all
  @all
end

#created_atObject (readonly)

Returns the value of attribute created_at.



7
8
9
# File 'lib/semaph/model/job_collection.rb', line 7

def created_at
  @created_at
end

#done_atObject (readonly)

Returns the value of attribute done_at.



7
8
9
# File 'lib/semaph/model/job_collection.rb', line 7

def done_at
  @done_at
end

#pending_atObject (readonly)

Returns the value of attribute pending_at.



7
8
9
# File 'lib/semaph/model/job_collection.rb', line 7

def pending_at
  @pending_at
end

#pipelineObject (readonly)

Returns the value of attribute pipeline.



7
8
9
# File 'lib/semaph/model/job_collection.rb', line 7

def pipeline
  @pipeline
end

#queuing_atObject (readonly)

Returns the value of attribute queuing_at.



7
8
9
# File 'lib/semaph/model/job_collection.rb', line 7

def queuing_at
  @queuing_at
end

#running_atObject (readonly)

Returns the value of attribute running_at.



7
8
9
# File 'lib/semaph/model/job_collection.rb', line 7

def running_at
  @running_at
end

#stopping_atObject (readonly)

Returns the value of attribute stopping_at.



7
8
9
# File 'lib/semaph/model/job_collection.rb', line 7

def stopping_at
  @stopping_at
end

Instance Method Details

#failedObject



23
24
25
# File 'lib/semaph/model/job_collection.rb', line 23

def failed
  @all.select(&:failed?)
end

#incompleteObject



19
20
21
# File 'lib/semaph/model/job_collection.rb', line 19

def incomplete
  @all.reject(&:finished?)
end

#reloadObject



13
14
15
16
17
# File 'lib/semaph/model/job_collection.rb', line 13

def reload
  workflow = @pipeline.workflow
  project = workflow.project
  @all = parse_content(project.client.pipeline(@pipeline.id))
end