module Authenticatable
  class Authentication
    # uses the hasshable concern
    include Hashable
        
    # requires the user object and the password the user submitted at login
    def initialize(user, password)
      @user = user
      @password = password
    end

    # Converts the password to a has
    # Checks converted hash against the stored hash to see if it matches
    def login!
      password_hash == @user.password ? true : false
    end
  end
end
