Class: Jobshop::AuthenticationService

Inherits:
Object
  • Object
show all
Defined in:
app/services/jobshop/authentication_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email, password) ⇒ AuthenticationService

Returns a new instance of AuthenticationService.



5
6
7
8
# File 'app/services/jobshop/authentication_service.rb', line 5

def initialize(email, password)
  @email = email
  @password = password
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



3
4
5
# File 'app/services/jobshop/authentication_service.rb', line 3

def email
  @email
end

#passwordObject (readonly)

Returns the value of attribute password.



3
4
5
# File 'app/services/jobshop/authentication_service.rb', line 3

def password
  @password
end

Instance Method Details

#performObject



10
11
12
# File 'app/services/jobshop/authentication_service.rb', line 10

def perform
  Jobshop::JWTService.encode(user_id: user.id) if user
end