Class: Unit::Types::Beneficiary

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(full_name, date_of_birth = nil) ⇒ Beneficiary

Returns a new instance of Beneficiary.

Parameters:

  • full_name (FullName)
  • date_of_birth (Date) (defaults to: nil)


11
12
13
14
# File 'lib/unit/types/beneficiary.rb', line 11

def initialize(full_name, date_of_birth = nil)
  @full_name = full_name
  @date_of_birth = date_of_birth
end

Instance Attribute Details

#date_of_birthObject (readonly)

Returns the value of attribute date_of_birth.



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

def date_of_birth
  @date_of_birth
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



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

def full_name
  @full_name
end

Instance Method Details

#representObject



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

def represent
  payload = {
    fullName: full_name.represent,
    dateOfBirth: date_of_birth
  }
  payload.compact
end