Class: Unit::Types::Officer
- Inherits:
-
Object
- Object
- Unit::Types::Officer
- Defined in:
- lib/unit/types/officer.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#date_of_birth ⇒ Object
readonly
Returns the value of attribute date_of_birth.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#nationality ⇒ Object
readonly
Returns the value of attribute nationality.
-
#passport ⇒ Object
readonly
Returns the value of attribute passport.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#ssn ⇒ Object
readonly
Returns the value of attribute ssn.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(full_name, date_of_birth, address, phone, email, ssn, status = nil, title = nil, passport = nil, nationality = nil) ⇒ Officer
constructor
A new instance of Officer.
- #represent ⇒ Object
Constructor Details
#initialize(full_name, date_of_birth, address, phone, email, ssn, status = nil, title = nil, passport = nil, nationality = nil) ⇒ Officer
Returns a new instance of Officer.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/unit/types/officer.rb', line 19 def initialize(full_name, date_of_birth, address, phone, email, ssn, status = nil, title = nil, passport = nil, nationality = nil) @full_name = full_name @date_of_birth = date_of_birth @address = address @phone = phone @email = email @status = status @title = title @ssn = ssn @passport = passport @nationality = nationality end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def address @address end |
#date_of_birth ⇒ Object (readonly)
Returns the value of attribute date_of_birth.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def date_of_birth @date_of_birth end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def email @email end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def full_name @full_name end |
#nationality ⇒ Object (readonly)
Returns the value of attribute nationality.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def nationality @nationality end |
#passport ⇒ Object (readonly)
Returns the value of attribute passport.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def passport @passport end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def phone @phone end |
#ssn ⇒ Object (readonly)
Returns the value of attribute ssn.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def ssn @ssn end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def status @status end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/unit/types/officer.rb', line 6 def title @title end |
Instance Method Details
#represent ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/unit/types/officer.rb', line 34 def represent payload = { fullName: full_name.represent, dateOfBirth: date_of_birth, address: address.represent, phone: phone.represent, email: email, ssn: ssn, status: status, title: title, passport: passport, nationality: nationality } payload.compact end |