Class: Monban::Services::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/monban/services/authentication.rb

Overview

Authentication service. Checks to see if the credentials provided are valid

Since:

  • 0.0.15

Instance Method Summary collapse

Constructor Details

#initialize(user, undigested_token) ⇒ Authentication

Initialize service

Parameters:

  • user (User)

    A user object

  • undigested_token (String)

    An undigested password

Since:

  • 0.0.15



10
11
12
13
# File 'lib/monban/services/authentication.rb', line 10

def initialize user, undigested_token
  @user = user
  @undigested_token = undigested_token
end

Instance Method Details

#performUser, false

Perform the service

Returns:

  • (User)

    if authentication succeeds

  • (false)

    if authentication fails

Since:

  • 0.0.15



19
20
21
22
23
24
25
# File 'lib/monban/services/authentication.rb', line 19

def perform
  if authenticated?
    user
  else
    false
  end
end