Class: GVIVE::Identity::Driver

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

Instance Attribute Summary collapse

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(coc, fullname, photo = false, signature = false) ⇒ Driver

Certificate of Competence required Fullname of card holder as it appears on the card Optionally specify whether you want to return a Base64Encoded Photo Optionally specify whether you want to return a Base64Encoded signature

Parameters:

  • coc (String)
  • fullname (String)
  • photo (Boolean) (defaults to: false)
  • signature (Boolean) (defaults to: false)


14
15
16
17
# File 'lib/gvive/identity/driver.rb', line 14

def initialize(coc, fullname, photo = false, signature = false)
  super(coc, photo, signature)
  @fullname = fullname
end

Instance Attribute Details

#fullnameObject

Returns the value of attribute fullname.



4
5
6
# File 'lib/gvive/identity/driver.rb', line 4

def fullname
  @fullname
end

Instance Method Details

#valid?Boolean

Implementing valid? method signature as described in Identity Class

Returns:

  • (Boolean)


20
21
22
23
24
# File 'lib/gvive/identity/driver.rb', line 20

def valid?
  @response = gvive_request(driver_endpoint, id_params({ coc: @id, fname: @fullname}))
  @data = @response.to_o
  @response.success?
end