Class: PassGen::Password
- Inherits:
-
String
- Object
- String
- PassGen::Password
- Defined in:
- lib/passgen/password.rb
Constant Summary collapse
- LETTERS =
('a'..'z').to_a
- NUMBERS =
('0'..'9').to_a
Instance Method Summary collapse
- #hexed ⇒ Object
-
#initialize(options = {}) ⇒ Password
constructor
A new instance of Password.
Constructor Details
#initialize(options = {}) ⇒ Password
Returns a new instance of Password.
9 10 11 12 13 14 |
# File 'lib/passgen/password.rb', line 9 def initialize(={}) @count = [:length] || 10 super(random_characters) rescue SystemStackError => e raise e, 'try specifying a shorter password length' end |
Instance Method Details
#hexed ⇒ Object
16 17 18 |
# File 'lib/passgen/password.rb', line 16 def hexed Digest::SHA1.hexdigest(self) end |