Class: Mindee::Product::FR::Payslip::PayslipV2Employee

Inherits:
Mindee::Parsing::Standard::FeatureField show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/fr/payslip/payslip_v2_employee.rb

Overview

Information about the employee.

Instance Attribute Summary collapse

Attributes inherited from Mindee::Parsing::Standard::AbstractField

#bounding_box, #confidence, #page_id, #polygon

Instance Method Summary collapse

Methods inherited from Mindee::Parsing::Standard::FeatureField

#format_for_display

Methods inherited from Mindee::Parsing::Standard::AbstractField

array_confidence, array_sum, float_to_string

Constructor Details

#initialize(prediction, page_id) ⇒ PayslipV2Employee

Returns a new instance of PayslipV2Employee.

Parameters:

  • prediction (Hash)
  • page_id (Integer, nil)


36
37
38
39
40
41
42
43
44
45
46
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 36

def initialize(prediction, page_id)
  super(prediction, page_id)
  @address = prediction['address']
  @date_of_birth = prediction['date_of_birth']
  @first_name = prediction['first_name']
  @last_name = prediction['last_name']
  @phone_number = prediction['phone_number']
  @registration_number = prediction['registration_number']
  @social_security_number = prediction['social_security_number']
  @page_id = page_id
end

Instance Attribute Details

#addressString (readonly)

The address of the employee.

Returns:

  • (String)


14
15
16
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 14

def address
  @address
end

#date_of_birthString (readonly)

The date of birth of the employee.

Returns:

  • (String)


17
18
19
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 17

def date_of_birth
  @date_of_birth
end

#first_nameString (readonly)

The first name of the employee.

Returns:

  • (String)


20
21
22
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 20

def first_name
  @first_name
end

#last_nameString (readonly)

The last name of the employee.

Returns:

  • (String)


23
24
25
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 23

def last_name
  @last_name
end

#phone_numberString (readonly)

The phone number of the employee.

Returns:

  • (String)


26
27
28
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 26

def phone_number
  @phone_number
end

#registration_numberString (readonly)

The registration number of the employee.

Returns:

  • (String)


29
30
31
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 29

def registration_number
  @registration_number
end

#social_security_numberString (readonly)

The social security number of the employee.

Returns:

  • (String)


32
33
34
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 32

def social_security_number
  @social_security_number
end

Instance Method Details

#printable_valuesHash

Returns:

  • (Hash)


49
50
51
52
53
54
55
56
57
58
59
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 49

def printable_values
  printable = {}
  printable[:address] = format_for_display(@address)
  printable[:date_of_birth] = format_for_display(@date_of_birth)
  printable[:first_name] = format_for_display(@first_name)
  printable[:last_name] = format_for_display(@last_name)
  printable[:phone_number] = format_for_display(@phone_number)
  printable[:registration_number] = format_for_display(@registration_number)
  printable[:social_security_number] = format_for_display(@social_security_number)
  printable
end

#to_sString

Returns:

  • (String)


62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/mindee/product/fr/payslip/payslip_v2_employee.rb', line 62

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Address: #{printable[:address]}"
  out_str << "\n  :Date of Birth: #{printable[:date_of_birth]}"
  out_str << "\n  :First Name: #{printable[:first_name]}"
  out_str << "\n  :Last Name: #{printable[:last_name]}"
  out_str << "\n  :Phone Number: #{printable[:phone_number]}"
  out_str << "\n  :Registration Number: #{printable[:registration_number]}"
  out_str << "\n  :Social Security Number: #{printable[:social_security_number]}"
  out_str
end