Module: LobbyBoy::SessionController::Functions

Included in:
LobbyBoy::SessionController
Defined in:
app/controllers/lobby_boy/session_controller.rb

Overview

Defines used functions. All of which are only dependent on their input parameters and not on some random global state.

Class Method Summary collapse

Class Method Details

.compact_hash(hash) ⇒ Object

Returns a new hash only containing entries the values of which are not nil.



57
58
59
# File 'app/controllers/lobby_boy/session_controller.rb', line 57

def compact_hash(hash)
  hash.reject { |_, v| v.nil? }
end

.logged_in?Boolean

Returns true if the user is logged in locally or false if they aren’t or we don’t know whether or not they are.

Returns:

  • (Boolean)


68
69
70
# File 'app/controllers/lobby_boy/session_controller.rb', line 68

def logged_in?
  instance_exec &LobbyBoy.client.logged_in
end

.omniauth_prefixObject



61
62
63
# File 'app/controllers/lobby_boy/session_controller.rb', line 61

def omniauth_prefix
  ::OmniAuth.config.path_prefix
end