Class: GVIVE::Identities
- Inherits:
-
Object
- Object
- GVIVE::Identities
- Includes:
- Utils
- Defined in:
- lib/gvive/identities.rb
Direct Known Subclasses
GVIVE::Identity::Driver, GVIVE::Identity::Passport, GVIVE::Identity::Voter
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#id ⇒ Object
Returns the value of attribute id.
-
#photo ⇒ Object
Returns the value of attribute photo.
-
#response ⇒ Object
Returns the value of attribute response.
-
#signature ⇒ Object
Returns the value of attribute signature.
Attributes included from Utils
#amount, #response_text, #result, #status, #transaction_id, #uuid
Instance Method Summary collapse
-
#id_params(params = {}) ⇒ Object
Automatically merge photo & signature into the request We don’t want to repeat this across all subclasses :).
-
#initialize(id, photo = false, signature = false) ⇒ Identities
constructor
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.
-
#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.
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
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
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/gvive/identities.rb', line 5 def data @data end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/gvive/identities.rb', line 5 def id @id end |
#photo ⇒ Object
Returns the value of attribute photo.
5 6 7 |
# File 'lib/gvive/identities.rb', line 5 def photo @photo end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/gvive/identities.rb', line 5 def response @response end |
#signature ⇒ Object
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
33 |
# File 'lib/gvive/identities.rb', line 33 def valid?; end |