Class: Mindee::Product::BillOfLading::BillOfLadingV1Consignee
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::BillOfLading::BillOfLadingV1Consignee
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb
Overview
The party to whom the goods are being shipped.
Instance Attribute Summary collapse
-
#address ⇒ String
readonly
The address of the consignee.
-
#email ⇒ String
readonly
The email of the shipper.
-
#name ⇒ String
readonly
The name of the consignee.
-
#phone ⇒ String
readonly
The phone number of the consignee.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ BillOfLadingV1Consignee
constructor
A new instance of BillOfLadingV1Consignee.
- #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) ⇒ BillOfLadingV1Consignee
Returns a new instance of BillOfLadingV1Consignee.
26 27 28 29 30 31 32 33 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb', line 26 def initialize(prediction, page_id) super(prediction, page_id) @address = prediction['address'] @email = prediction['email'] @name = prediction['name'] @phone = prediction['phone'] @page_id = page_id end |
Instance Attribute Details
#address ⇒ String (readonly)
The address of the consignee.
13 14 15 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb', line 13 def address @address end |
#email ⇒ String (readonly)
The email of the shipper.
16 17 18 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb', line 16 def email @email end |
#name ⇒ String (readonly)
The name of the consignee.
19 20 21 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb', line 19 def name @name end |
#phone ⇒ String (readonly)
The phone number of the consignee.
22 23 24 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb', line 22 def phone @phone end |
Instance Method Details
#printable_values ⇒ Hash
36 37 38 39 40 41 42 43 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb', line 36 def printable_values printable = {} printable[:address] = format_for_display(@address) printable[:email] = format_for_display(@email) printable[:name] = format_for_display(@name) printable[:phone] = format_for_display(@phone) printable end |
#to_s ⇒ String
46 47 48 49 50 51 52 53 54 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb', line 46 def to_s printable = printable_values out_str = String.new out_str << "\n :Address: #{printable[:address]}" out_str << "\n :Email: #{printable[:email]}" out_str << "\n :Name: #{printable[:name]}" out_str << "\n :Phone: #{printable[:phone]}" out_str end |