Class: Unit::Types::Trustee

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/types/trustee.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(full_name, ssn, email, phone, address, date_of_birth = nil) ⇒ Trustee

Returns a new instance of Trustee.

Parameters:

  • full_name (FullName)
  • ssn (String)
  • email (String)
  • phone (Phone)
  • address (Address)
  • date_of_birth (Date) (defaults to: nil)
    • optional



15
16
17
18
19
20
21
22
# File 'lib/unit/types/trustee.rb', line 15

def initialize(full_name, ssn, email, phone, address, date_of_birth = nil)
  @full_name = full_name
  @ssn = ssn
  @email = email
  @phone = phone
  @address = address
  @date_of_birth = date_of_birth
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



7
8
9
# File 'lib/unit/types/trustee.rb', line 7

def address
  @address
end

#date_of_birthObject (readonly)

Returns the value of attribute date_of_birth.



7
8
9
# File 'lib/unit/types/trustee.rb', line 7

def date_of_birth
  @date_of_birth
end

#emailObject (readonly)

Returns the value of attribute email.



7
8
9
# File 'lib/unit/types/trustee.rb', line 7

def email
  @email
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



7
8
9
# File 'lib/unit/types/trustee.rb', line 7

def full_name
  @full_name
end

#phoneObject (readonly)

Returns the value of attribute phone.



7
8
9
# File 'lib/unit/types/trustee.rb', line 7

def phone
  @phone
end

#ssnObject (readonly)

Returns the value of attribute ssn.



7
8
9
# File 'lib/unit/types/trustee.rb', line 7

def ssn
  @ssn
end

Instance Method Details

#representObject



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/unit/types/trustee.rb', line 24

def represent
  payload = {
    fullName: full_name.represent,
    ssn: ssn,
    email: email,
    phone: phone.represent,
    address: address.represent,
    dateOfBirth: date_of_birth
  }
  payload.compact
end