Class: OpenIdAuthentication::Result
- Inherits:
-
Object
- Object
- OpenIdAuthentication::Result
- Defined in:
- lib/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 collapse
Instance Method Summary collapse
-
#initialize(code) ⇒ Result
constructor
A new instance of Result.
- #message ⇒ Object
- #status ⇒ Object
- #successful? ⇒ Boolean
- #unsuccessful? ⇒ Boolean
Constructor Details
#initialize(code) ⇒ Result
Returns a new instance of Result
56 57 58 |
# File 'lib/plugins/open_id_authentication/lib/open_id_authentication.rb', line 56 def initialize(code) @code = code end |
Class Method Details
.[](code) ⇒ Object
52 53 54 |
# File 'lib/plugins/open_id_authentication/lib/open_id_authentication.rb', line 52 def self.[](code) new(code) end |
Instance Method Details
#message ⇒ Object
74 75 76 |
# File 'lib/plugins/open_id_authentication/lib/open_id_authentication.rb', line 74 def ERROR_MESSAGES[@code] end |
#status ⇒ Object
60 61 62 |
# File 'lib/plugins/open_id_authentication/lib/open_id_authentication.rb', line 60 def status @code end |
#successful? ⇒ Boolean
66 67 68 |
# File 'lib/plugins/open_id_authentication/lib/open_id_authentication.rb', line 66 def successful? @code == :successful end |
#unsuccessful? ⇒ Boolean
70 71 72 |
# File 'lib/plugins/open_id_authentication/lib/open_id_authentication.rb', line 70 def unsuccessful? ERROR_MESSAGES.keys.include?(@code) end |