Class: Mindee::Product::US::UsMail::UsMailV2SenderAddress
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::US::UsMail::UsMailV2SenderAddress
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb
Overview
The address of the sender.
Instance Attribute Summary collapse
-
#city ⇒ String
readonly
The city of the sender’s address.
-
#complete ⇒ String
readonly
The complete address of the sender.
-
#postal_code ⇒ String
readonly
The postal code of the sender’s address.
-
#state ⇒ String
readonly
Second part of the ISO 3166-2 code, consisting of two letters indicating the US State.
-
#street ⇒ String
readonly
The street of the sender’s address.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ UsMailV2SenderAddress
constructor
A new instance of UsMailV2SenderAddress.
- #printable_values ⇒ Hash
- #to_s ⇒ String
Methods inherited from Mindee::Parsing::Standard::FeatureField
Methods inherited from Mindee::Parsing::Standard::AbstractField
array_confidence, array_sum, float_to_string
Constructor Details
#initialize(prediction, page_id) ⇒ UsMailV2SenderAddress
Returns a new instance of UsMailV2SenderAddress.
30 31 32 33 34 35 36 37 38 |
# File 'lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb', line 30 def initialize(prediction, page_id) super(prediction, page_id) @city = prediction['city'] @complete = prediction['complete'] @postal_code = prediction['postal_code'] @state = prediction['state'] @street = prediction['street'] @page_id = page_id end |
Instance Attribute Details
#city ⇒ String (readonly)
The city of the sender’s address.
14 15 16 |
# File 'lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb', line 14 def city @city end |
#complete ⇒ String (readonly)
The complete address of the sender.
17 18 19 |
# File 'lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb', line 17 def complete @complete end |
#postal_code ⇒ String (readonly)
The postal code of the sender’s address.
20 21 22 |
# File 'lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb', line 20 def postal_code @postal_code end |
#state ⇒ String (readonly)
Second part of the ISO 3166-2 code, consisting of two letters indicating the US State.
23 24 25 |
# File 'lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb', line 23 def state @state end |
#street ⇒ String (readonly)
The street of the sender’s address.
26 27 28 |
# File 'lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb', line 26 def street @street end |
Instance Method Details
#printable_values ⇒ Hash
41 42 43 44 45 46 47 48 49 |
# File 'lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb', line 41 def printable_values printable = {} printable[:city] = format_for_display(@city) printable[:complete] = format_for_display(@complete) printable[:postal_code] = format_for_display(@postal_code) printable[:state] = format_for_display(@state) printable[:street] = format_for_display(@street) printable end |
#to_s ⇒ String
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb', line 52 def to_s printable = printable_values out_str = String.new out_str << "\n :City: #{printable[:city]}" out_str << "\n :Complete Address: #{printable[:complete]}" out_str << "\n :Postal Code: #{printable[:postal_code]}" out_str << "\n :State: #{printable[:state]}" out_str << "\n :Street: #{printable[:street]}" out_str end |