Module: SimpleTelnetServer::HasLogin::ClassMethods
- Defined in:
- lib/em-simple_telnet_server/has_login.rb
Instance Method Summary collapse
-
#has_login(username, password, role: :user) ⇒ Object
Adds a pair of login credentials.
-
#login_credentials ⇒ Hash{login_type Symbol => Array<(username String, password String)>}
Registered (read/write) login credentials.
Instance Method Details
#has_login(username, password, role: :user) ⇒ Object
Adds a pair of login credentials.
27 28 29 |
# File 'lib/em-simple_telnet_server/has_login.rb', line 27 def has_login(username, password, role: :user) login_credentials[role] = [ username, password ] end |
#login_credentials ⇒ Hash{login_type Symbol => Array<(username String, password String)>}
Returns registered (read/write) login credentials.
19 20 21 |
# File 'lib/em-simple_telnet_server/has_login.rb', line 19 def login_credentials [:login_credentials] ||= {} end |