Class: Mindee::Product::ProofOfAddress::ProofOfAddressV1Document
- Inherits:
-
Mindee::Parsing::Common::Prediction
- Object
- Mindee::Parsing::Common::Prediction
- Mindee::Product::ProofOfAddress::ProofOfAddressV1Document
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb
Overview
Proof of Address API version 1.1 document data.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#date ⇒ Mindee::Parsing::Standard::DateField
readonly
The date the document was issued.
-
#dates ⇒ Array<Mindee::Parsing::Standard::DateField>
readonly
List of dates found on the document.
-
#issuer_address ⇒ Mindee::Parsing::Standard::StringField
readonly
The address of the document’s issuer.
-
#issuer_company_registration ⇒ Array<Mindee::Parsing::Standard::CompanyRegistrationField>
readonly
List of company registrations found for the issuer.
-
#issuer_name ⇒ Mindee::Parsing::Standard::StringField
readonly
The name of the person or company issuing the document.
-
#locale ⇒ Mindee::Parsing::Standard::LocaleField
readonly
The locale detected on the document.
-
#recipient_address ⇒ Mindee::Parsing::Standard::StringField
readonly
The address of the recipient.
-
#recipient_company_registration ⇒ Array<Mindee::Parsing::Standard::CompanyRegistrationField>
readonly
List of company registrations found for the recipient.
-
#recipient_name ⇒ Mindee::Parsing::Standard::StringField
readonly
The name of the person or company receiving the document.
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ ProofOfAddressV1Document
constructor
A new instance of ProofOfAddressV1Document.
- #to_s ⇒ String
Constructor Details
#initialize(prediction, page_id) ⇒ ProofOfAddressV1Document
Returns a new instance of ProofOfAddressV1Document.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 41 def initialize(prediction, page_id) super() @date = DateField.new(prediction['date'], page_id) @dates = [] prediction['dates'].each do |item| @dates.push(DateField.new(item, page_id)) end @issuer_address = StringField.new(prediction['issuer_address'], page_id) @issuer_company_registration = [] prediction['issuer_company_registration'].each do |item| @issuer_company_registration.push(CompanyRegistrationField.new(item, page_id)) end @issuer_name = StringField.new(prediction['issuer_name'], page_id) @locale = LocaleField.new(prediction['locale'], page_id) @recipient_address = StringField.new(prediction['recipient_address'], page_id) @recipient_company_registration = [] prediction['recipient_company_registration'].each do |item| @recipient_company_registration.push(CompanyRegistrationField.new(item, page_id)) end @recipient_name = StringField.new(prediction['recipient_name'], page_id) end |
Instance Attribute Details
#date ⇒ Mindee::Parsing::Standard::DateField (readonly)
The date the document was issued.
13 14 15 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 13 def date @date end |
#dates ⇒ Array<Mindee::Parsing::Standard::DateField> (readonly)
List of dates found on the document.
16 17 18 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 16 def dates @dates end |
#issuer_address ⇒ Mindee::Parsing::Standard::StringField (readonly)
The address of the document’s issuer.
19 20 21 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 19 def issuer_address @issuer_address end |
#issuer_company_registration ⇒ Array<Mindee::Parsing::Standard::CompanyRegistrationField> (readonly)
List of company registrations found for the issuer.
22 23 24 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 22 def issuer_company_registration @issuer_company_registration end |
#issuer_name ⇒ Mindee::Parsing::Standard::StringField (readonly)
The name of the person or company issuing the document.
25 26 27 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 25 def issuer_name @issuer_name end |
#locale ⇒ Mindee::Parsing::Standard::LocaleField (readonly)
The locale detected on the document.
28 29 30 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 28 def locale @locale end |
#recipient_address ⇒ Mindee::Parsing::Standard::StringField (readonly)
The address of the recipient.
31 32 33 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 31 def recipient_address @recipient_address end |
#recipient_company_registration ⇒ Array<Mindee::Parsing::Standard::CompanyRegistrationField> (readonly)
List of company registrations found for the recipient.
34 35 36 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 34 def recipient_company_registration @recipient_company_registration end |
#recipient_name ⇒ Mindee::Parsing::Standard::StringField (readonly)
The name of the person or company receiving the document.
37 38 39 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 37 def recipient_name @recipient_name end |
Instance Method Details
#to_s ⇒ String
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/mindee/product/proof_of_address/proof_of_address_v1_document.rb', line 64 def to_s issuer_company_registration = @issuer_company_registration.join("\n #{' ' * 30}") recipient_company_registration = @recipient_company_registration.join("\n #{' ' * 33}") dates = @dates.join("\n #{' ' * 7}") out_str = String.new out_str << "\n:Locale: #{@locale}".rstrip out_str << "\n:Issuer Name: #{@issuer_name}".rstrip out_str << "\n:Issuer Company Registrations: #{issuer_company_registration}".rstrip out_str << "\n:Issuer Address: #{@issuer_address}".rstrip out_str << "\n:Recipient Name: #{@recipient_name}".rstrip out_str << "\n:Recipient Company Registrations: #{recipient_company_registration}".rstrip out_str << "\n:Recipient Address: #{@recipient_address}".rstrip out_str << "\n:Dates: #{dates}".rstrip out_str << "\n:Date of Issue: #{@date}".rstrip out_str[1..].to_s end |