Class: GVIVE::Identities

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/gvive/identities.rb

Instance Attribute Summary collapse

Attributes included from Utils

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

Instance Method Summary collapse

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(id, photo = false, signature = false) ⇒ Identities

Identity classes have 3 common requirements

  • ID to search

  • Option to return a Base64Encoded Image of the ID

  • Option to return a Base64Encoded Signature of the ID

Optionally specify whether you want to return a Base64Encoded Photo Optionally specify whether you want to return a Base64Encoded Signature

Parameters:

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


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

def initialize(id, photo = false, signature = false)
  @id = id
  @photo = photo
  @signature = signature
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/gvive/identities.rb', line 5

def data
  @data
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/gvive/identities.rb', line 5

def id
  @id
end

#photoObject

Returns the value of attribute photo.



5
6
7
# File 'lib/gvive/identities.rb', line 5

def photo
  @photo
end

#responseObject

Returns the value of attribute response.



5
6
7
# File 'lib/gvive/identities.rb', line 5

def response
  @response
end

#signatureObject

Returns the value of attribute signature.



5
6
7
# File 'lib/gvive/identities.rb', line 5

def signature
  @signature
end

Instance Method Details

#id_params(params = {}) ⇒ Object

Automatically merge photo & signature into the request We don’t want to repeat this across all subclasses :)



24
25
26
# File 'lib/gvive/identities.rb', line 24

def id_params(params = {})
  params.merge(incp: @photo, incs: @signature)
end

#valid?Boolean

Implement this method in subclass Validate Identity with GVIVE Web Service Assign OpenStruct Object via @response.to_o call

  • to @data variable if request was sucessful

Returns:

  • (Boolean)


33
# File 'lib/gvive/identities.rb', line 33

def valid?; end