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
rubocop:disable Naming/MethodName.
-
#birthplace ⇒ Object
rubocop:disable Naming/MethodName.
-
#city ⇒ Object
rubocop:disable Naming/MethodName.
-
#country ⇒ Object
rubocop:enable Naming/MethodName.
-
#custom1 ⇒ Object
rubocop:disable Naming/MethodName.
-
#custom2 ⇒ Object
rubocop:disable Naming/MethodName.
-
#custom3 ⇒ Object
rubocop:disable Naming/MethodName.
-
#custom4 ⇒ Object
rubocop:disable Naming/MethodName.
-
#custom5 ⇒ Object
rubocop:disable Naming/MethodName.
-
#email ⇒ Object
rubocop:disable Naming/MethodName.
-
#firstname ⇒ Object
rubocop:disable Naming/MethodName.
-
#gender ⇒ Object
rubocop:enable Naming/MethodName.
-
#lastname ⇒ Object
rubocop:disable Naming/MethodName.
-
#mobilephone ⇒ Object
rubocop:disable Naming/MethodName.
-
#nationality ⇒ Object
rubocop:disable Naming/MethodName.
-
#preferredLang ⇒ Object
rubocop:disable Naming/MethodName.
-
#street ⇒ Object
rubocop:disable Naming/MethodName.
-
#streetnumber ⇒ Object
rubocop:disable Naming/MethodName.
-
#title ⇒ Object
rubocop:disable Naming/MethodName.
-
#trackingid ⇒ Object
rubocop:disable Naming/MethodName.
-
#zipcode ⇒ Object
rubocop:disable Naming/MethodName.
Instance Method Summary collapse
-
#birthday ⇒ Object
Getter / Setter ############.
- #birthday=(birthday) ⇒ Object
-
#initialize(params = {}) ⇒ IdentificationData
constructor
A new instance of IdentificationData.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ IdentificationData
Returns a new instance of IdentificationData.
21 22 23 24 25 26 27 |
# File 'lib/idnow/models/identification_data.rb', line 21 def initialize(params = {}) params.each_key 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
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def birthname @birthname end |
#birthplace ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def birthplace @birthplace end |
#city ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def city @city end |
#country ⇒ Object
rubocop:enable Naming/MethodName
19 20 21 |
# File 'lib/idnow/models/identification_data.rb', line 19 def country @country end |
#custom1 ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def custom1 @custom1 end |
#custom2 ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def custom2 @custom2 end |
#custom3 ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def custom3 @custom3 end |
#custom4 ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def custom4 @custom4 end |
#custom5 ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def custom5 @custom5 end |
#email ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def email @email end |
#firstname ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def firstname @firstname end |
#gender ⇒ Object
rubocop:enable Naming/MethodName
19 20 21 |
# File 'lib/idnow/models/identification_data.rb', line 19 def gender @gender end |
#lastname ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def lastname @lastname end |
#mobilephone ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def mobilephone @mobilephone end |
#nationality ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def nationality @nationality end |
#preferredLang ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def preferredLang @preferredLang end |
#street ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def street @street end |
#streetnumber ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def streetnumber @streetnumber end |
#title ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def title @title end |
#trackingid ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def trackingid @trackingid end |
#zipcode ⇒ Object
rubocop:disable Naming/MethodName
13 14 15 |
# File 'lib/idnow/models/identification_data.rb', line 13 def zipcode @zipcode end |
Instance Method Details
#birthday ⇒ Object
Getter / Setter ############
39 40 41 |
# File 'lib/idnow/models/identification_data.rb', line 39 def birthday @birthday&.strftime('%Y-%m-%d') end |
#birthday=(birthday) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/idnow/models/identification_data.rb', line 43 def birthday=(birthday) @birthday = if birthday.instance_of?(Date) || birthday.instance_of?(DateTime) birthday else Date.parse(birthday) end end |
#to_json(*_args) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/idnow/models/identification_data.rb', line 29 def to_json(*_args) result = {} instance_variables.each do |attribute| result[attribute.to_s.delete('@')] = instance_variable_get(attribute) end result.to_json end |