Class: Gratan::Identifier::Auto
- Inherits:
-
Object
- Object
- Gratan::Identifier::Auto
- Defined in:
- lib/gratan/identifier/auto.rb
Instance Method Summary collapse
- #identify(user, host) ⇒ Object
-
#initialize(output, options = {}) ⇒ Auto
constructor
A new instance of Auto.
Constructor Details
#initialize(output, options = {}) ⇒ Auto
Returns a new instance of Auto.
2 3 4 5 6 |
# File 'lib/gratan/identifier/auto.rb', line 2 def initialize(output, = {}) @output = output = @cache = {} end |
Instance Method Details
#identify(user, host) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/gratan/identifier/auto.rb', line 8 def identify(user, host) if @cache[user] password = @cache[user] else password = mkpasswd @cache[user] = password end puts_password(user, host, password) password end |