Class: Dionysus::Producer::PartitionKey
- Inherits:
-
Object
- Object
- Dionysus::Producer::PartitionKey
- Defined in:
- lib/dionysus/producer/partition_key.rb
Instance Method Summary collapse
-
#initialize(resource, config: Dionysus::Producer.configuration) ⇒ PartitionKey
constructor
A new instance of PartitionKey.
- #to_key(responder:) ⇒ Object
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 |