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.
-
#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.
14 15 16 17 18 19 20 |
# File 'lib/idnow/models/identification_data.rb', line 14 def initialize(params = {}) params.keys.each do |key| fail 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.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def birthname @birthname end |
#birthplace ⇒ Object
Returns the value of attribute birthplace.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def birthplace @birthplace end |
#city ⇒ Object
Returns the value of attribute city.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def country @country end |
#custom1 ⇒ Object
Returns the value of attribute custom1.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def custom1 @custom1 end |
#custom2 ⇒ Object
Returns the value of attribute custom2.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def custom2 @custom2 end |
#custom3 ⇒ Object
Returns the value of attribute custom3.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def custom3 @custom3 end |
#custom4 ⇒ Object
Returns the value of attribute custom4.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def custom4 @custom4 end |
#custom5 ⇒ Object
Returns the value of attribute custom5.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def custom5 @custom5 end |
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def email @email end |
#firstname ⇒ Object
Returns the value of attribute firstname.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def firstname @firstname end |
#gender ⇒ Object
Returns the value of attribute gender.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def gender @gender end |
#lastname ⇒ Object
Returns the value of attribute lastname.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def lastname @lastname end |
#mobilephone ⇒ Object
Returns the value of attribute mobilephone.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def mobilephone @mobilephone end |
#nationality ⇒ Object
Returns the value of attribute nationality.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def nationality @nationality end |
#street ⇒ Object
Returns the value of attribute street.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def street @street end |
#streetnumber ⇒ Object
Returns the value of attribute streetnumber.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def streetnumber @streetnumber end |
#title ⇒ Object
Returns the value of attribute title.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def title @title end |
#trackingid ⇒ Object
Returns the value of attribute trackingid.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def trackingid @trackingid end |
#zipcode ⇒ Object
Returns the value of attribute zipcode.
10 11 12 |
# File 'lib/idnow/models/identification_data.rb', line 10 def zipcode @zipcode end |
Instance Method Details
#birthday ⇒ Object
Getter / Setter ############
32 33 34 |
# File 'lib/idnow/models/identification_data.rb', line 32 def birthday @birthday.strftime('%Y-%m-%d') if @birthday end |
#birthday=(birthday) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/idnow/models/identification_data.rb', line 36 def birthday=(birthday) @birthday = if birthday.instance_of?(Date) || birthday.instance_of?(DateTime) birthday else Date.parse(birthday) end end |
#to_json ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/idnow/models/identification_data.rb', line 22 def to_json result = {} instance_variables.each do |attribute| result[attribute.to_s.delete('@')] = instance_variable_get(attribute) end result.to_json end |