Class: Unit::Types::Officer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(full_name, date_of_birth, address, phone, email, ssn, status = nil, title = nil, passport = nil, nationality = nil, evaluation_params = nil, id_theft_score = nil, occupation = nil, annual_income = nil, source_of_income = nil) ⇒ Officer

Returns a new instance of Officer.

Parameters:

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

  • title (String) (defaults to: nil)
    • optional

  • passport (String) (defaults to: nil)
    • optional

  • nationality (String) (defaults to: nil)
    • optional



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/unit/types/officer.rb', line 21

def initialize(full_name, date_of_birth, address, phone, email, ssn,
               status = nil, title = nil, passport = nil,
               nationality = nil, evaluation_params = nil, id_theft_score = nil, occupation = nil,
               annual_income = nil, source_of_income = 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
  @evaluation_params = evaluation_params
  @id_theft_score = id_theft_score
  @occupation = occupation
  @annual_income = annual_income
  @source_of_income = source_of_income
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def address
  @address
end

#annual_incomeObject (readonly)

Returns the value of attribute annual_income.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def annual_income
  @annual_income
end

#date_of_birthObject (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

#emailObject (readonly)

Returns the value of attribute email.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def email
  @email
end

#evaluation_paramsObject (readonly)

Returns the value of attribute evaluation_params.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def evaluation_params
  @evaluation_params
end

#full_nameObject (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

#id_theft_scoreObject (readonly)

Returns the value of attribute id_theft_score.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def id_theft_score
  @id_theft_score
end

#nationalityObject (readonly)

Returns the value of attribute nationality.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def nationality
  @nationality
end

#occupationObject (readonly)

Returns the value of attribute occupation.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def occupation
  @occupation
end

#passportObject (readonly)

Returns the value of attribute passport.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def passport
  @passport
end

#phoneObject (readonly)

Returns the value of attribute phone.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def phone
  @phone
end

#source_of_incomeObject (readonly)

Returns the value of attribute source_of_income.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def source_of_income
  @source_of_income
end

#ssnObject (readonly)

Returns the value of attribute ssn.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def ssn
  @ssn
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/unit/types/officer.rb', line 6

def status
  @status
end

#titleObject (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

#representObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/unit/types/officer.rb', line 42

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,
      evaluation_params: evaluation_params,
      id_theft_score: id_theft_score,
      occupation: occupation,
      annual_income: annual_income,
      source_of_income: source_of_income
    }
  payload.compact
end