Class: Bosh::Monitor::Plugins::ResurrectorHelper::JobInstanceKey

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/monitor/plugins/resurrector_helper.rb

Overview

Hashable tuple of the identifying properties of a job

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(deployment, job, id) ⇒ JobInstanceKey

Returns a new instance of JobInstanceKey.



8
9
10
11
12
# File 'lib/bosh/monitor/plugins/resurrector_helper.rb', line 8

def initialize(deployment, job, id)
  @deployment = deployment
  @job        = job
  @id         = id
end

Instance Attribute Details

#deploymentObject

Returns the value of attribute deployment.



6
7
8
# File 'lib/bosh/monitor/plugins/resurrector_helper.rb', line 6

def deployment
  @deployment
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/bosh/monitor/plugins/resurrector_helper.rb', line 6

def id
  @id
end

#jobObject

Returns the value of attribute job.



6
7
8
# File 'lib/bosh/monitor/plugins/resurrector_helper.rb', line 6

def job
  @job
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
22
# File 'lib/bosh/monitor/plugins/resurrector_helper.rb', line 18

def eql?(other)
  other.deployment == deployment &&
      other.job == job &&
      other.id == id
end

#hashObject



14
15
16
# File 'lib/bosh/monitor/plugins/resurrector_helper.rb', line 14

def hash
  (deployment.to_s + job.to_s + id.to_s).hash
end

#to_sObject



24
25
26
# File 'lib/bosh/monitor/plugins/resurrector_helper.rb', line 24

def to_s
  [deployment, job, id].join('/')
end