Class: RakeSecrets::Types::Alphanumeric

Inherits:
Object
  • Object
show all
Defined in:
lib/rake_secrets/types/alphanumeric.rb

Constant Summary collapse

LOWERCASE_CHARACTERS =
('a'..'z').to_a
UPPERCASE_CHARACTERS =
('A'..'Z').to_a
NUMBER_CHARACTERS =
('0'..'9').to_a

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Alphanumeric

Returns a new instance of Alphanumeric.



12
13
14
15
16
17
# File 'lib/rake_secrets/types/alphanumeric.rb', line 12

def initialize(opts = {})
  @delegate = CharacterSet.new(
    character_set(opts[:case]),
    length: opts[:length] || 32
  )
end

Instance Method Details

#generateObject



19
20
21
# File 'lib/rake_secrets/types/alphanumeric.rb', line 19

def generate
  @delegate.generate
end