Class: MiniAuth::Guard

Inherits:
Object
  • Object
show all
Defined in:
lib/mini_auth/guard.rb

Direct Known Subclasses

ApiGuard, SessionGuard, TestGuard

Instance Method Summary collapse

Instance Method Details

#attempt!(credentials, remember = false) ⇒ Object

Parameters:

  • credentials (Hash)
  • remember (Boolean) (defaults to: false)

Raises:

  • (NotImplementedError)


6
7
8
# File 'lib/mini_auth/guard.rb', line 6

def attempt!(credentials, remember = false)
  raise NotImplementedError, 'Use implementation instead.'
end

#auth_urlString

Returns A URL to authentication path.

Returns:

  • (String)

    A URL to authentication path

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/mini_auth/guard.rb', line 33

def auth_url
  raise NotImplementedError, 'Use implementation instead.'
end

#guest?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/mini_auth/guard.rb', line 28

def guest?
  !logged_in?
end

#logged_in?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/mini_auth/guard.rb', line 24

def logged_in?
  user.present?
end

#login!(user, remember = false) ⇒ Object

Parameters:

  • user (Object)
  • remember (Boolean) (defaults to: false)

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/mini_auth/guard.rb', line 12

def login!(user, remember = false)
  raise NotImplementedError, 'Use implementation instead.'
end

#logout!Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/mini_auth/guard.rb', line 16

def logout!
  raise NotImplementedError, 'Use implementation instead.'
end

#userObject

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/mini_auth/guard.rb', line 20

def user
  raise NotImplementedError, 'Use implementation instead.'
end