lib/castronaut/authentication_result.rb in masover-castronaut-0.4.4.5 vs lib/castronaut/authentication_result.rb in masover-castronaut-0.5.0.1
- old
+ new
@@ -1,13 +1,15 @@
module Castronaut
class AuthenticationResult
- attr_reader :username, :identifier, :error_message
+ attr_reader :username, :identifier, :error_message, :extra_info
- def initialize(username, error_message=nil, identifier=nil)
+ def initialize(username, error_message=nil, options={})
@username = username
+ identifier = options[:identifier]
@identifier = identifier.nil? ? username : identifier
+ @extra_info = options[:extra_info]
@error_message = error_message
Castronaut.logger.info("#{self.class} - #{@error_message} for #{@username}") if @error_message && @username
end
def valid?