Class: SmartId::Api::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_id/api/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_body, authentication_hash) ⇒ Response

Returns a new instance of Response.



5
6
7
8
9
# File 'lib/smart_id/api/response.rb', line 5

def initialize(response_body, authentication_hash)
  @body = response_body
  @session_id = response_body["sessionID"]
  @authentication_hash = authentication_hash
end

Instance Attribute Details

#session_idObject (readonly)

Returns the value of attribute session_id.



3
4
5
# File 'lib/smart_id/api/response.rb', line 3

def session_id
  @session_id
end

Instance Method Details

#verification_codeObject



11
12
13
# File 'lib/smart_id/api/response.rb', line 11

def verification_code
  @verification_code ||= SmartId::VerificationCodeCalculator.calculate(@authentication_hash.calculate_digest)
end