Class: Mindee::Product::FR::Payslip::PayslipV2Employer

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

Overview

Information about the employer.

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) ⇒ PayslipV2Employer

Returns a new instance of PayslipV2Employer.

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_employer.rb', line 36

def initialize(prediction, page_id)
  super(prediction, page_id)
  @address = prediction['address']
  @company_id = prediction['company_id']
  @company_site = prediction['company_site']
  @naf_code = prediction['naf_code']
  @name = prediction['name']
  @phone_number = prediction['phone_number']
  @urssaf_number = prediction['urssaf_number']
  @page_id = page_id
end

Instance Attribute Details

#addressString (readonly)

The address of the employer.

Returns:

  • (String)


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

def address
  @address
end

#company_idString (readonly)

The company ID of the employer.

Returns:

  • (String)


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

def company_id
  @company_id
end

#company_siteString (readonly)

The site of the company.

Returns:

  • (String)


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

def company_site
  @company_site
end

#naf_codeString (readonly)

The NAF code of the employer.

Returns:

  • (String)


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

def naf_code
  @naf_code
end

#nameString (readonly)

The name of the employer.

Returns:

  • (String)


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

def name
  @name
end

#phone_numberString (readonly)

The phone number of the employer.

Returns:

  • (String)


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

def phone_number
  @phone_number
end

#urssaf_numberString (readonly)

The URSSAF number of the employer.

Returns:

  • (String)


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

def urssaf_number
  @urssaf_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_employer.rb', line 49

def printable_values
  printable = {}
  printable[:address] = format_for_display(@address)
  printable[:company_id] = format_for_display(@company_id)
  printable[:company_site] = format_for_display(@company_site)
  printable[:naf_code] = format_for_display(@naf_code)
  printable[:name] = format_for_display(@name)
  printable[:phone_number] = format_for_display(@phone_number)
  printable[:urssaf_number] = format_for_display(@urssaf_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_employer.rb', line 62

def to_s
  printable = printable_values
  out_str = String.new
  out_str << "\n  :Address: #{printable[:address]}"
  out_str << "\n  :Company ID: #{printable[:company_id]}"
  out_str << "\n  :Company Site: #{printable[:company_site]}"
  out_str << "\n  :NAF Code: #{printable[:naf_code]}"
  out_str << "\n  :Name: #{printable[:name]}"
  out_str << "\n  :Phone Number: #{printable[:phone_number]}"
  out_str << "\n  :URSSAF Number: #{printable[:urssaf_number]}"
  out_str
end