Class: Idnow::UserData
- Inherits:
-
Object
- Object
- Idnow::UserData
- Includes:
- Jsonable
- Defined in:
- lib/idnow/models/user_data.rb
Instance Attribute Summary collapse
-
#birthday ⇒ Object
Returns the value of attribute birthday.
-
#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.
-
#firstname ⇒ Object
Returns the value of attribute firstname.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#lastname ⇒ Object
Returns the value of attribute lastname.
-
#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.
-
#zipcode ⇒ Object
Returns the value of attribute zipcode.
Instance Method Summary collapse
- #address ⇒ Object
-
#initialize(data) ⇒ UserData
constructor
A new instance of UserData.
Methods included from Jsonable
Constructor Details
#initialize(data) ⇒ UserData
Returns a new instance of UserData.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/idnow/models/user_data.rb', line 8 def initialize(data) @birthday = dig_value('birthday', data) @birthname = dig_value('birthname', data) @birthplace = dig_value('birthplace', data) @city = dig_value('address', 'city', data) @country = dig_value('address', 'country', data) @firstname = dig_value('firstname', data) @gender = dig_value('gender', data) @lastname = dig_value('lastname', data) @nationality = dig_value('nationality', data) @street = dig_value('address', 'street', data) @streetnumber = dig_value('address', 'streetnumber', data) @title = dig_value('title', data) @zipcode = dig_value('address', 'zipcode', data) end |
Instance Attribute Details
#birthday ⇒ Object
Returns the value of attribute birthday.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def birthday @birthday end |
#birthname ⇒ Object
Returns the value of attribute birthname.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def birthname @birthname end |
#birthplace ⇒ Object
Returns the value of attribute birthplace.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def birthplace @birthplace end |
#city ⇒ Object
Returns the value of attribute city.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def country @country end |
#firstname ⇒ Object
Returns the value of attribute firstname.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def firstname @firstname end |
#gender ⇒ Object
Returns the value of attribute gender.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def gender @gender end |
#lastname ⇒ Object
Returns the value of attribute lastname.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def lastname @lastname end |
#nationality ⇒ Object
Returns the value of attribute nationality.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def nationality @nationality end |
#street ⇒ Object
Returns the value of attribute street.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def street @street end |
#streetnumber ⇒ Object
Returns the value of attribute streetnumber.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def streetnumber @streetnumber end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def title @title end |
#zipcode ⇒ Object
Returns the value of attribute zipcode.
5 6 7 |
# File 'lib/idnow/models/user_data.rb', line 5 def zipcode @zipcode end |
Instance Method Details
#address ⇒ Object
24 25 26 |
# File 'lib/idnow/models/user_data.rb', line 24 def address "#{street} #{streetnumber}, #{zipcode} #{city}, #{country}" end |