Method: PkiExpress::TrustServiceSessionResult#initialize

Defined in:
lib/pki_express/trust_service_session_result.rb

#initialize(model) ⇒ TrustServiceSessionResult

Returns a new instance of TrustServiceSessionResult.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/pki_express/trust_service_session_result.rb', line 9

def initialize(model)
  @session = nil
  @custom_state = nil
  @service = nil
  @session_type = nil
  @expires_on = nil
  
  unless model.nil?
    @session = model.fetch(:session)
    @custom_state = model.fetch(:customState)
    @service = model.fetch(:service)
    @session_type = model.fetch(:type)

    expires_on = model.fetch(:expiresOn)
    if expires_on
      @expires_on = DateTime.iso8601(expires_on)
    end
  end
end