Class: TFA::TotpCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/tfa/totp_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(storage) ⇒ TotpCommand



3
4
5
# File 'lib/tfa/totp_command.rb', line 3

def initialize(storage)
  @storage = storage
end

Instance Method Details

#run(arguments) ⇒ Object



7
8
9
10
# File 'lib/tfa/totp_command.rb', line 7

def run(arguments)
  return password_for(secret_for(arguments.first)) if valid?(arguments)
  all_passwords
end