Class: Idnow::IdentificationDocument
- Inherits:
-
Object
- Object
- Idnow::IdentificationDocument
- Includes:
- Jsonable
- Defined in:
- lib/idnow/models/identification_document.rb
Instance Attribute Summary collapse
-
#country ⇒ Object
Returns the value of attribute country.
- #date_issued ⇒ Object
-
#issued_by ⇒ Object
Returns the value of attribute issued_by.
-
#number ⇒ Object
Returns the value of attribute number.
-
#type ⇒ Object
Returns the value of attribute type.
- #valid_until ⇒ Object
Instance Method Summary collapse
-
#initialize(data) ⇒ IdentificationDocument
constructor
A new instance of IdentificationDocument.
Methods included from Jsonable
Constructor Details
#initialize(data) ⇒ IdentificationDocument
Returns a new instance of IdentificationDocument.
10 11 12 13 14 15 16 17 |
# File 'lib/idnow/models/identification_document.rb', line 10 def initialize(data) @country = data.dig('country', 'value') @number = data.dig('number', 'value') @issued_by = data.dig('issuedby', 'value') @date_issued = data.dig('dateissued', 'value') @type = data.dig('type', 'value') @valid_until = data.dig('validuntil', 'value') end |
Instance Attribute Details
#country ⇒ Object
Returns the value of attribute country.
7 8 9 |
# File 'lib/idnow/models/identification_document.rb', line 7 def country @country end |
#date_issued ⇒ Object
19 20 21 |
# File 'lib/idnow/models/identification_document.rb', line 19 def date_issued Date.parse(@date_issued) if @date_issued end |
#issued_by ⇒ Object
Returns the value of attribute issued_by.
7 8 9 |
# File 'lib/idnow/models/identification_document.rb', line 7 def issued_by @issued_by end |
#number ⇒ Object
Returns the value of attribute number.
7 8 9 |
# File 'lib/idnow/models/identification_document.rb', line 7 def number @number end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/idnow/models/identification_document.rb', line 7 def type @type end |
#valid_until ⇒ Object
23 24 25 |
# File 'lib/idnow/models/identification_document.rb', line 23 def valid_until Date.parse(@valid_until) if @valid_until end |