module PasswordGenerator

Constants

DOWNCASES
GENERATE_OptArg
NUMBERS
SYMBOLS
UPPERCASES
VERSION
WHITESPACE

Public Class Methods

generate(length, options={}) click to toggle source

@param length [Fixnum, to_int] @param options [Hash] @option options [Boolean] :avoid_downcases @option options [Boolean] :avoid_uppercases @option options [Boolean] :avoid_numbers @option options [Boolean] :avoid_symbols @option options [Boolean] :avoid_whitespace @return [String]

# File lib/password_generator.rb, line 79
def generate(length, options={})
  length = length.to_int
  unless length >= 1
    raise ArgumentError, "too small length thrown: #{length.inspect}"
  end
  options = GENERATE_OptArg.parse options

  Generator.new(length, options).generate
end