Class: OpenIdAuthentication::Result
- Inherits:
-
Object
- Object
- OpenIdAuthentication::Result
- Defined in:
- vendor/plugins/open_id_authentication/lib/open_id_authentication.rb
Constant Summary
- ERROR_MESSAGES =
{ :missing => "Sorry, the OpenID server couldn't be found", :invalid => "Sorry, but this does not appear to be a valid OpenID", :canceled => "OpenID verification was canceled", :failed => "OpenID verification failed", :setup_needed => "OpenID verification needs setup" }
Class Method Summary
Instance Method Summary
-
- (Result) initialize(code)
constructor
A new instance of Result.
- - (Object) message
- - (Object) status
- - (Boolean) successful?
- - (Boolean) unsuccessful?
Constructor Details
- (Result) initialize(code)
A new instance of Result
51 52 53 |
# File 'vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 51 def initialize(code) @code = code end |
Class Method Details
+ (Object) [](code)
47 48 49 |
# File 'vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 47 def self.[](code) new(code) end |
Instance Method Details
- (Object) message
69 70 71 |
# File 'vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 69 def ERROR_MESSAGES[@code] end |
- (Object) status
55 56 57 |
# File 'vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 55 def status @code end |
- (Boolean) successful?
61 62 63 |
# File 'vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 61 def successful? @code == :successful end |
- (Boolean) unsuccessful?
65 66 67 |
# File 'vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 65 def unsuccessful? ERROR_MESSAGES.keys.include?(@code) end |