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, index) ⇒ 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, index)
  @deployment = deployment
  @job        = job
  @index      = index
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

#indexObject

Returns the value of attribute index.



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

def index
  @index
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.index == index
end

#hashObject



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

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

#to_sObject



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

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