Module: SimpleTelnetServer::HasLogin::ClassMethods

Defined in:
lib/em-simple_telnet_server/has_login.rb

Instance Method Summary collapse

Instance Method Details

#has_login(username, password, role: :user) ⇒ Object

Adds a pair of login credentials.

Parameters:

  • username (String)

    username

  • password (String)

    password

  • role (Symbol) (defaults to: :user)

    (:user) the associated role name



27
28
29
# File 'lib/em-simple_telnet_server/has_login.rb', line 27

def (username, password, role: :user)
  [role] = [ username, password ]
end

#login_credentialsHash{login_type Symbol => Array<(username String, password String)>}

Returns registered (read/write) login credentials.

Returns:

  • (Hash{login_type Symbol => Array<(username String, password String)>})

    registered (read/write) login credentials



19
20
21
# File 'lib/em-simple_telnet_server/has_login.rb', line 19

def 
  options[:login_credentials] ||= {}
end