Class: GVIVE::Identity::Passport

Inherits:
GVIVE::Identities show all
Defined in:
lib/gvive/identity/passport.rb

Instance Attribute Summary

Attributes inherited from GVIVE::Identities

#data, #id, #photo, #response, #signature

Attributes included from Utils

#amount, #response, #response_text, #result, #status, #transaction_id, #uuid

Instance Method Summary collapse

Methods inherited from GVIVE::Identities

#id_params

Methods included from Utils

#driver_endpoint, #endpoint, #gvive_request, #http_connect, #passport_endpoint, #voter_endpoint

Methods included from Encoding

#auth_token, #hmac_digest, #request_concat

Constructor Details

#initialize(passport_id, photo = false, signature = false) ⇒ Passport

Passport ID number required Optionally specify whether you want to return a Base64Encoded Photo Optionally specify whether you want to return a Base64Encoded signature

Parameters:

  • passport_id (String)
  • photo (Boolean) (defaults to: false)
  • signature (Boolean) (defaults to: false)

11
12
13
# File 'lib/gvive/identity/passport.rb', line 11

def initialize(passport_id, photo = false, signature = false)
  super(passport_id, photo, signature)
end

Instance Method Details

#valid?Boolean

Implementing valid? method signature as described in Identity Class

Returns:

  • (Boolean)

16
17
18
19
20
# File 'lib/gvive/identity/passport.rb', line 16

def valid?
  @response = gvive_request(passport_endpoint, id_params({ pid: @id }))
  @data = @response.to_o
  @response.success?
end