Class: Remind101::Command::Auth
- Inherits:
-
Base
- Object
- Base
- Remind101::Command::Auth
- Defined in:
- lib/remind101/command/auth.rb
Overview
authentication (login, logout)
Instance Method Summary collapse
-
#index ⇒ Object
auth.
-
#login ⇒ Object
auth:login.
-
#logout ⇒ Object
auth:logout.
-
#token ⇒ Object
auth:token.
-
#whoami ⇒ Object
auth:whoami.
Instance Method Details
#index ⇒ Object
auth
Authenticate, display token and current user
10 11 12 13 14 |
# File 'lib/remind101/command/auth.rb', line 10 def index validate_arguments! Remind101::Command::Help.new.send(:help_for_command, current_command) end |
#login ⇒ Object
auth:login
log in with your remind101 credentials
Example:
$ remind101 auth:login Enter your Remind101 credentials: Email: [email protected] Password (typing will be hidden): Authentication successful.
28 29 30 31 32 33 |
# File 'lib/remind101/command/auth.rb', line 28 def login validate_arguments! Remind101::Auth.login display "Authentication successful." end |
#logout ⇒ Object
auth:logout
clear local authentication credentials
Example:
$ remind101 auth:logout Local credentials cleared.
46 47 48 49 50 51 |
# File 'lib/remind101/command/auth.rb', line 46 def logout validate_arguments! Remind101::Auth.logout display "Local credentials cleared." end |
#token ⇒ Object
auth:token
display your api token
Example:
$ remind101 auth:token ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCD
64 65 66 67 68 |
# File 'lib/remind101/command/auth.rb', line 64 def token validate_arguments! display Remind101::Auth.token end |
#whoami ⇒ Object
79 80 81 82 83 |
# File 'lib/remind101/command/auth.rb', line 79 def whoami validate_arguments! display Remind101::Auth.user end |