Class: SharedBroker::KeyProvider::Static

Inherits:
Object
  • Object
show all
Defined in:
lib/shared_broker/key_provider.rb

Overview

Static key provider for backward compatibility

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ Static

Returns a new instance of Static.

Raises:

  • (ArgumentError)


9
10
11
12
# File 'lib/shared_broker/key_provider.rb', line 9

def initialize(key)
  raise ArgumentError, "Expected key to be a 32-byte String, got #{key.inspect}" unless key.is_a?(String)
  @key = key
end

Instance Method Details

#active_key_id_for(_topic) ⇒ Object



22
23
24
# File 'lib/shared_broker/key_provider.rb', line 22

def active_key_id_for(_topic)
  nil
end

#key_for(_topic) ⇒ Object



14
15
16
# File 'lib/shared_broker/key_provider.rb', line 14

def key_for(_topic)
  @key
end

#key_for_id(_key_id) ⇒ Object



18
19
20
# File 'lib/shared_broker/key_provider.rb', line 18

def key_for_id(_key_id)
  @key
end