Class: SmartId::Api::ConfirmationResponse
- Inherits:
-
Object
- Object
- SmartId::Api::ConfirmationResponse
- Defined in:
- lib/smart_id/api/confirmation_response.rb
Constant Summary collapse
- RUNNING_STATE =
"RUNNING"
- COMPLETED_STATE =
"COMPLETE"
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
- #certificate ⇒ Object
- #certificate_level ⇒ Object
- #confirmation_running? ⇒ Boolean
- #document_number ⇒ Object
- #end_result ⇒ Object
- #ignored_properties ⇒ Object
-
#initialize(response_body, hashed_data) ⇒ ConfirmationResponse
constructor
A new instance of ConfirmationResponse.
- #signature ⇒ Object
- #signature_algorithm ⇒ Object
- #state ⇒ Object
Constructor Details
#initialize(response_body, hashed_data) ⇒ ConfirmationResponse
Returns a new instance of ConfirmationResponse.
8 9 10 11 |
# File 'lib/smart_id/api/confirmation_response.rb', line 8 def initialize(response_body, hashed_data) @body = response_body validate!(hashed_data) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/smart_id/api/confirmation_response.rb', line 6 def body @body end |
Instance Method Details
#certificate ⇒ Object
33 34 35 |
# File 'lib/smart_id/api/confirmation_response.rb', line 33 def certificate @certificate ||= SmartId::AuthenticationCertificate::Certificate.new(@body.dig("cert", "value")) end |
#certificate_level ⇒ Object
29 30 31 |
# File 'lib/smart_id/api/confirmation_response.rb', line 29 def certificate_level @body.dig("cert", "certificateLevel") end |
#confirmation_running? ⇒ Boolean
13 14 15 |
# File 'lib/smart_id/api/confirmation_response.rb', line 13 def confirmation_running? state == RUNNING_STATE end |
#document_number ⇒ Object
25 26 27 |
# File 'lib/smart_id/api/confirmation_response.rb', line 25 def document_number @body.dig("result", "documentNumber") end |
#end_result ⇒ Object
21 22 23 |
# File 'lib/smart_id/api/confirmation_response.rb', line 21 def end_result @body.dig("result", "endResult") end |
#ignored_properties ⇒ Object
45 46 47 |
# File 'lib/smart_id/api/confirmation_response.rb', line 45 def ignored_properties @body["ignoredProperties"] end |
#signature ⇒ Object
41 42 43 |
# File 'lib/smart_id/api/confirmation_response.rb', line 41 def signature @body.dig("signature", "value") end |
#signature_algorithm ⇒ Object
37 38 39 |
# File 'lib/smart_id/api/confirmation_response.rb', line 37 def signature_algorithm @body.dig("signature", "algorithm") end |
#state ⇒ Object
17 18 19 |
# File 'lib/smart_id/api/confirmation_response.rb', line 17 def state @body["state"] end |