Class: Hello::Business::Authentication::SignIn

Inherits:
Base
  • Object
show all
Defined in:
lib/hello/business/authentication/sign_in.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#alert_message, #error_message, #errors, #success_message, #t

Instance Attribute Details

#loginObject

Returns the value of attribute login.



5
6
7
# File 'lib/hello/business/authentication/sign_in.rb', line 5

def 
  @login
end

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/hello/business/authentication/sign_in.rb', line 5

def password
  @password
end

Instance Method Details

#authenticate(login, password) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/hello/business/authentication/sign_in.rb', line 7

def authenticate(, password)
  @ignited = true
  @login = 
  @password = password

  validates_presence_of :login, :password
  return false if any_errors?

  
  
  return false if any_errors?

  check_password_matches
  return false if any_errors?

  true
end

#bad_login?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/hello/business/authentication/sign_in.rb', line 25

def bad_login?
  !!
end

#bad_password?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/hello/business/authentication/sign_in.rb', line 29

def bad_password?
  !!@bad_password
end

#userObject



33
34
35
# File 'lib/hello/business/authentication/sign_in.rb', line 33

def user
  @user ||= ::User.new
end