Class: OpenIdAuthentication::Result
- Defined in:
- lib/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb
Constant Summary collapse
- 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.
50 51 52 |
# File 'lib/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 50 def initialize(code) @code = code end |
Class Method Details
.[](code) ⇒ Object
46 47 48 |
# File 'lib/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 46 def self.[](code) new(code) end |
Instance Method Details
#message ⇒ Object
68 69 70 |
# File 'lib/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 68 def ERROR_MESSAGES[@code] end |
#status ⇒ Object
54 55 56 |
# File 'lib/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 54 def status @code end |
#successful? ⇒ Boolean
60 61 62 |
# File 'lib/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 60 def successful? @code == :successful end |
#unsuccessful? ⇒ Boolean
64 65 66 |
# File 'lib/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb', line 64 def unsuccessful? ERROR_MESSAGES.keys.include?(@code) end |