Class: Idnow::IdentificationData
- Inherits:
-
Object
- Object
- Idnow::IdentificationData
- Defined in:
- lib/idnow/models/identification_data.rb
Defined Under Namespace
Modules: Gender
Instance Attribute Summary collapse
-
#birthname ⇒ Object
Returns the value of attribute birthname.
-
#birthplace ⇒ Object
Returns the value of attribute birthplace.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#custom1 ⇒ Object
Returns the value of attribute custom1.
-
#custom2 ⇒ Object
Returns the value of attribute custom2.
-
#custom3 ⇒ Object
Returns the value of attribute custom3.
-
#custom4 ⇒ Object
Returns the value of attribute custom4.
-
#custom5 ⇒ Object
Returns the value of attribute custom5.
-
#email ⇒ Object
Returns the value of attribute email.
-
#firstname ⇒ Object
Returns the value of attribute firstname.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#lastname ⇒ Object
Returns the value of attribute lastname.
-
#mobilephone ⇒ Object
Returns the value of attribute mobilephone.
-
#nationality ⇒ Object
Returns the value of attribute nationality.
-
#preferredLang ⇒ Object
Returns the value of attribute preferredLang.
-
#street ⇒ Object
Returns the value of attribute street.
-
#streetnumber ⇒ Object
Returns the value of attribute streetnumber.
-
#title ⇒ Object
Returns the value of attribute title.
-
#trackingid ⇒ Object
Returns the value of attribute trackingid.
-
#zipcode ⇒ Object
Returns the value of attribute zipcode.
Instance Method Summary collapse
-
#birthday ⇒ Object
Getter / Setter ############.
- #birthday=(birthday) ⇒ Object
-
#initialize(params = {}) ⇒ IdentificationData
constructor
A new instance of IdentificationData.
- #to_json ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ IdentificationData
Returns a new instance of IdentificationData.
19 20 21 22 23 24 25 |
# File 'lib/idnow/models/identification_data.rb', line 19 def initialize(params = {}) params.keys.each do |key| raise ArgumentError, "Attribute #{key} is not supported!" unless respond_to?(key.to_sym) send("#{key}=", params[key]) end end |
Instance Attribute Details
#birthname ⇒ Object
Returns the value of attribute birthname.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def birthname @birthname end |
#birthplace ⇒ Object
Returns the value of attribute birthplace.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def birthplace @birthplace end |
#city ⇒ Object
Returns the value of attribute city.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
17 18 19 |
# File 'lib/idnow/models/identification_data.rb', line 17 def country @country end |
#custom1 ⇒ Object
Returns the value of attribute custom1.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def custom1 @custom1 end |
#custom2 ⇒ Object
Returns the value of attribute custom2.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def custom2 @custom2 end |
#custom3 ⇒ Object
Returns the value of attribute custom3.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def custom3 @custom3 end |
#custom4 ⇒ Object
Returns the value of attribute custom4.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def custom4 @custom4 end |
#custom5 ⇒ Object
Returns the value of attribute custom5.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def custom5 @custom5 end |
#email ⇒ Object
Returns the value of attribute email.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def email @email end |
#firstname ⇒ Object
Returns the value of attribute firstname.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def firstname @firstname end |
#gender ⇒ Object
Returns the value of attribute gender.
17 18 19 |
# File 'lib/idnow/models/identification_data.rb', line 17 def gender @gender end |
#lastname ⇒ Object
Returns the value of attribute lastname.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def lastname @lastname end |
#mobilephone ⇒ Object
Returns the value of attribute mobilephone.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def mobilephone @mobilephone end |
#nationality ⇒ Object
Returns the value of attribute nationality.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def nationality @nationality end |
#preferredLang ⇒ Object
Returns the value of attribute preferredLang.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def preferredLang @preferredLang end |
#street ⇒ Object
Returns the value of attribute street.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def street @street end |
#streetnumber ⇒ Object
Returns the value of attribute streetnumber.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def streetnumber @streetnumber end |
#title ⇒ Object
Returns the value of attribute title.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def title @title end |
#trackingid ⇒ Object
Returns the value of attribute trackingid.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def trackingid @trackingid end |
#zipcode ⇒ Object
Returns the value of attribute zipcode.
12 13 14 |
# File 'lib/idnow/models/identification_data.rb', line 12 def zipcode @zipcode end |
Instance Method Details
#birthday ⇒ Object
Getter / Setter ############
37 38 39 |
# File 'lib/idnow/models/identification_data.rb', line 37 def birthday @birthday&.strftime('%Y-%m-%d') end |
#birthday=(birthday) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/idnow/models/identification_data.rb', line 41 def birthday=(birthday) @birthday = if birthday.instance_of?(Date) || birthday.instance_of?(DateTime) birthday else Date.parse(birthday) end end |
#to_json ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/idnow/models/identification_data.rb', line 27 def to_json result = {} instance_variables.each do |attribute| result[attribute.to_s.delete('@')] = instance_variable_get(attribute) end result.to_json end |