class Ravelin::Password

Constants

FAILURE_REASONS

Attributes

failure_reason[RW]
password_hashed[RW]
success[RW]

Public Instance Methods

password=(passwd) click to toggle source

Alternative interface, because when the attr is called “password_hashed”, the end user might think they need to hash the password themselves

# File lib/ravelin/password.rb, line 10
def password=(passwd)
  @password_hashed = Digest::SHA256.hexdigest(passwd)
end
password_hashed=(passwd) click to toggle source
# File lib/ravelin/password.rb, line 14
def password_hashed=(passwd)
  @password_hashed = passwd
end
validate() click to toggle source
Calls superclass method
# File lib/ravelin/password.rb, line 20
def validate
  super
  if !success && !FAILURE_REASONS.include?(failure_reason)
    raise ArgumentError.new("Failure reason value must be one of #{FAILURE_REASONS.join(', ')}")
  end
end