Class: OpenID::AX::StoreResponse
- Defined in:
- lib/openid/extensions/ax.rb
Overview
An indication that the store request was processed along with this OpenID transaction.
Constant Summary collapse
- SUCCESS_MODE =
'store_response_success'
- FAILURE_MODE =
'store_response_failure'
Constants inherited from AXMessage
Instance Attribute Summary collapse
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
Attributes inherited from AXMessage
Class Method Summary collapse
Instance Method Summary collapse
- #get_extension_args ⇒ Object
-
#initialize(succeeded = true, error_message = nil) ⇒ StoreResponse
constructor
A new instance of StoreResponse.
- #succeeded? ⇒ Boolean
Methods inherited from Extension
Constructor Details
#initialize(succeeded = true, error_message = nil) ⇒ StoreResponse
Returns a new instance of StoreResponse.
507 508 509 510 511 512 513 514 515 516 517 518 |
# File 'lib/openid/extensions/ax.rb', line 507 def initialize(succeeded = true, = nil) super() if succeeded and raise Error, "Error message included in a success response" end if succeeded @mode = SUCCESS_MODE else @mode = FAILURE_MODE end @error_message = end |
Instance Attribute Details
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
505 506 507 |
# File 'lib/openid/extensions/ax.rb', line 505 def @error_message end |
Class Method Details
.from_success_response(success_response) ⇒ Object
520 521 522 523 524 |
# File 'lib/openid/extensions/ax.rb', line 520 def self.from_success_response(success_response) resp = nil ax_args = success_response..get_args(NS_URI) resp = ax_args.key?('error') ? new(false, ax_args['error']) : new end |
Instance Method Details
#get_extension_args ⇒ Object
530 531 532 533 534 535 536 |
# File 'lib/openid/extensions/ax.rb', line 530 def get_extension_args ax_args = new_args if !succeeded? and ax_args['error'] = @error_message end return ax_args end |
#succeeded? ⇒ Boolean
526 527 528 |
# File 'lib/openid/extensions/ax.rb', line 526 def succeeded? @mode == SUCCESS_MODE end |