Class: RakeSecrets::Types::Alphabetic

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

Constant Summary collapse

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

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Alphabetic

Returns a new instance of Alphabetic.



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

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

Instance Method Details

#generateObject



18
19
20
# File 'lib/rake_secrets/types/alphabetic.rb', line 18

def generate
  @delegate.generate
end