Class: Mindee::Product::US::W9::W9V1PagePrediction

Inherits:
W9V1Document show all
Includes:
Mindee::Parsing::Standard
Defined in:
lib/mindee/product/us/w9/w9_v1_page.rb

Overview

W9 V1 page prediction.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prediction, page_id) ⇒ W9V1PagePrediction

Returns a new instance of W9V1PagePrediction.

Parameters:

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


65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 65

def initialize(prediction, page_id)
  @address = StringField.new(prediction['address'], page_id)
  @business_name = StringField.new(prediction['business_name'], page_id)
  @city_state_zip = StringField.new(prediction['city_state_zip'], page_id)
  @ein = StringField.new(prediction['ein'], page_id)
  @name = StringField.new(prediction['name'], page_id)
  @signature_date_position = PositionField.new(prediction['signature_date_position'], page_id)
  @signature_position = PositionField.new(prediction['signature_position'], page_id)
  @ssn = StringField.new(prediction['ssn'], page_id)
  @tax_classification = StringField.new(prediction['tax_classification'], page_id)
  @tax_classification_llc = StringField.new(prediction['tax_classification_llc'], page_id)
  @tax_classification_other_details = StringField.new(prediction['tax_classification_other_details'], page_id)
  @w9_revision_date = StringField.new(prediction['w9_revision_date'], page_id)
  super()
end

Instance Attribute Details

#addressMindee::Parsing::Standard::StringField (readonly)

The street address (number, street, and apt. or suite no.) of the applicant.



28
29
30
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 28

def address
  @address
end

#business_nameMindee::Parsing::Standard::StringField (readonly)

The business name or disregarded entity name, if different from Name.



31
32
33
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 31

def business_name
  @business_name
end

#city_state_zipMindee::Parsing::Standard::StringField (readonly)

The city, state, and ZIP code of the applicant.



34
35
36
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 34

def city_state_zip
  @city_state_zip
end

#einMindee::Parsing::Standard::StringField (readonly)

The employer identification number.



37
38
39
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 37

def ein
  @ein
end

#nameMindee::Parsing::Standard::StringField (readonly)

Name as shown on the applicant’s income tax return.



40
41
42
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 40

def name
  @name
end

#signature_date_positionMindee::Parsing::Standard::PositionField (readonly)

Position of the signature date on the document.



43
44
45
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 43

def signature_date_position
  @signature_date_position
end

#signature_positionMindee::Parsing::Standard::PositionField (readonly)

Position of the signature on the document.



46
47
48
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 46

def signature_position
  @signature_position
end

#ssnMindee::Parsing::Standard::StringField (readonly)

The applicant’s social security number.



49
50
51
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 49

def ssn
  @ssn
end

#tax_classificationMindee::Parsing::Standard::StringField (readonly)

The federal tax classification, which can vary depending on the revision date.



52
53
54
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 52

def tax_classification
  @tax_classification
end

#tax_classification_llcMindee::Parsing::Standard::StringField (readonly)

Depending on revision year, among S, C, P or D for Limited Liability Company Classification.



55
56
57
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 55

def tax_classification_llc
  @tax_classification_llc
end

#tax_classification_other_detailsMindee::Parsing::Standard::StringField (readonly)

Tax Classification Other Details.



58
59
60
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 58

def tax_classification_other_details
  @tax_classification_other_details
end

#w9_revision_dateMindee::Parsing::Standard::StringField (readonly)

The Revision month and year of the W9 form.



61
62
63
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 61

def w9_revision_date
  @w9_revision_date
end

Instance Method Details

#to_sString

Returns:

  • (String)


82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/mindee/product/us/w9/w9_v1_page.rb', line 82

def to_s
  out_str = String.new
  out_str << "\n:Name: #{@name}".rstrip
  out_str << "\n:SSN: #{@ssn}".rstrip
  out_str << "\n:Address: #{@address}".rstrip
  out_str << "\n:City State Zip: #{@city_state_zip}".rstrip
  out_str << "\n:Business Name: #{@business_name}".rstrip
  out_str << "\n:EIN: #{@ein}".rstrip
  out_str << "\n:Tax Classification: #{@tax_classification}".rstrip
  out_str << "\n:Tax Classification Other Details: #{@tax_classification_other_details}".rstrip
  out_str << "\n:W9 Revision Date: #{@w9_revision_date}".rstrip
  out_str << "\n:Signature Position: #{@signature_position}".rstrip
  out_str << "\n:Signature Date Position: #{@signature_date_position}".rstrip
  out_str << "\n:Tax Classification LLC: #{@tax_classification_llc}".rstrip
  out_str
end