Class: Synapse::ProcessManager::Correlation

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse/process_manager/correlation.rb

Overview

Combination key and value that is used to correlate incoming events with process instances

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ undefined

Parameters:

  • key (Symbol)
  • value (String)


14
15
16
17
# File 'lib/synapse/process_manager/correlation.rb', line 14

def initialize(key, value)
  @key = key.to_sym
  @value = value.to_s
end

Instance Attribute Details

#keySymbol (readonly)

Returns:

  • (Symbol)


6
7
8
# File 'lib/synapse/process_manager/correlation.rb', line 6

def key
  @key
end

#valueString (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/synapse/process_manager/correlation.rb', line 9

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



19
20
21
22
23
# File 'lib/synapse/process_manager/correlation.rb', line 19

def ==(other)
  self.class === other and
    other.key == @key and
    other.value == @value
end

#hashObject



27
28
29
# File 'lib/synapse/process_manager/correlation.rb', line 27

def hash
  @key.hash ^ @value.hash
end