Class: Mindee::Product::BillOfLading::BillOfLadingV1Carrier
- Inherits:
-
Mindee::Parsing::Standard::FeatureField
- Object
- Mindee::Parsing::Standard::AbstractField
- Mindee::Parsing::Standard::FeatureField
- Mindee::Product::BillOfLading::BillOfLadingV1Carrier
- Includes:
- Mindee::Parsing::Standard
- Defined in:
- lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb
Overview
The shipping company responsible for transporting the goods.
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The name of the carrier.
-
#professional_number ⇒ String
readonly
The professional number of the carrier.
-
#scac ⇒ String
readonly
The Standard Carrier Alpha Code (SCAC) of the carrier.
Attributes inherited from Mindee::Parsing::Standard::AbstractField
#bounding_box, #confidence, #page_id, #polygon
Instance Method Summary collapse
-
#initialize(prediction, page_id) ⇒ BillOfLadingV1Carrier
constructor
A new instance of BillOfLadingV1Carrier.
- #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) ⇒ BillOfLadingV1Carrier
Returns a new instance of BillOfLadingV1Carrier.
23 24 25 26 27 28 29 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb', line 23 def initialize(prediction, page_id) super(prediction, page_id) @name = prediction['name'] @professional_number = prediction['professional_number'] @scac = prediction['scac'] @page_id = page_id end |
Instance Attribute Details
#name ⇒ String (readonly)
The name of the carrier.
13 14 15 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb', line 13 def name @name end |
#professional_number ⇒ String (readonly)
The professional number of the carrier.
16 17 18 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb', line 16 def professional_number @professional_number end |
#scac ⇒ String (readonly)
The Standard Carrier Alpha Code (SCAC) of the carrier.
19 20 21 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb', line 19 def scac @scac end |
Instance Method Details
#printable_values ⇒ Hash
32 33 34 35 36 37 38 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb', line 32 def printable_values printable = {} printable[:name] = format_for_display(@name) printable[:professional_number] = format_for_display(@professional_number) printable[:scac] = format_for_display(@scac) printable end |
#to_s ⇒ String
41 42 43 44 45 46 47 48 |
# File 'lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb', line 41 def to_s printable = printable_values out_str = String.new out_str << "\n :Name: #{printable[:name]}" out_str << "\n :Professional Number: #{printable[:professional_number]}" out_str << "\n :SCAC: #{printable[:scac]}" out_str end |