Class: Unit::Types::TrustContact

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(full_name, email, phone, address, jwt_subject = nil) ⇒ TrustContact

Returns a new instance of TrustContact.

Parameters:

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



14
15
16
17
18
19
20
# File 'lib/unit/types/trust_contact.rb', line 14

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

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



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

def address
  @address
end

#emailObject (readonly)

Returns the value of attribute email.



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

def email
  @email
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



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

def full_name
  @full_name
end

#jwt_subjectObject (readonly)

Returns the value of attribute jwt_subject.



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

def jwt_subject
  @jwt_subject
end

#phoneObject (readonly)

Returns the value of attribute phone.



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

def phone
  @phone
end

Instance Method Details

#representObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/unit/types/trust_contact.rb', line 22

def represent
  payload = {
    fullName: full_name.represent,
    email: email,
    phone: phone.represent,
    address: address.represent,
    jwtSubject: jwt_subject
  }
  payload.compact
end