Class: Sbmt::Outbox::PartitionStrategies::NumberPartitioning

Inherits:
DryInteractor
  • Object
show all
Defined in:
app/interactors/sbmt/outbox/partition_strategies/number_partitioning.rb

Instance Method Summary collapse

Methods inherited from DryInteractor

call

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/interactors/sbmt/outbox/partition_strategies/number_partitioning.rb', line 10

def call
  parsed_key =
    case key
    when Integer
      key
    else
      key.delete("^0-9").to_i
    end

  Success(
    parsed_key % bucket_size
  )
end