Class: Dionysus::Producer::PartitionKey

Inherits:
Object
  • Object
show all
Defined in:
lib/dionysus/producer/partition_key.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource, config: Dionysus::Producer.configuration) ⇒ PartitionKey

Returns a new instance of PartitionKey.



7
8
9
10
# File 'lib/dionysus/producer/partition_key.rb', line 7

def initialize(resource, config: Dionysus::Producer.configuration)
  @resource = resource
  @config = config
end

Instance Method Details

#to_key(responder:) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/dionysus/producer/partition_key.rb', line 12

def to_key(responder:)
  if has_custom_partition_key?(responder)
    apply_custom_partition_key(responder)
  else
    apply_default_partition_key
  end
end