Class: DumpCleaner::Cleanup::CleaningSteps::GenerateRandomString

Inherits:
Base
  • Object
show all
Defined in:
lib/dump_cleaner/cleanup/cleaning_steps/generate_random_string.rb

Instance Attribute Summary

Attributes inherited from Base

#step_context

Instance Method Summary collapse

Methods inherited from Base

#crc32, #initialize, #raise_params_error

Constructor Details

This class inherits a constructor from DumpCleaner::Cleanup::CleaningSteps::Base

Instance Method Details

#run(character_set: "alphanumeric") ⇒ Object



9
10
11
12
13
14
# File 'lib/dump_cleaner/cleanup/cleaning_steps/generate_random_string.rb', line 9

def run(character_set: "alphanumeric")
  random = Random.new(crc32)

  step_context.current_value = random.alphanumeric(current_value.bytesize, chars: characters(character_set))
  step_context
end