Class: FreightKit::CLNI
- Inherits:
-
Carrier
- Object
- Carrier
- FreightKit::CLNI
- Includes:
- Rateable
- Defined in:
- lib/freight_kit/carriers/clni.rb
Constant Summary collapse
- REACTIVE_FREIGHT_CARRIER =
true
Class Attribute Summary collapse
-
.name ⇒ Object
readonly
Returns the value of attribute name.
-
.scac ⇒ Object
readonly
Returns the value of attribute scac.
Class Method Summary collapse
-
.find_rates_with_declared_value? ⇒ Boolean
service.
- .maximum_height ⇒ Object
- .maximum_weight ⇒ Object
- .minimum_length_for_overlength_fees ⇒ Object
- .overlength_fees_require_tariff? ⇒ Boolean
- .required_credential_types ⇒ Object
- .requirements ⇒ Object
Instance Method Summary collapse
-
#pod(tracking_number) ⇒ Object
Documents.
- #scanned_bol(tracking_number) ⇒ Object
-
#validate_packages(packages, tariff = nil) ⇒ Object
Rates.
Methods included from Rateable
Class Attribute Details
.name ⇒ Object (readonly)
Returns the value of attribute name.
42 43 44 |
# File 'lib/freight_kit/carriers/clni.rb', line 42 def name @name end |
.scac ⇒ Object (readonly)
Returns the value of attribute scac.
42 43 44 |
# File 'lib/freight_kit/carriers/clni.rb', line 42 def scac @scac end |
Class Method Details
.find_rates_with_declared_value? ⇒ Boolean
Note:
Explicitly set to false because though API allows this, it "doesn't quote correctly" per customer
service
8 9 10 |
# File 'lib/freight_kit/carriers/clni.rb', line 8 def find_rates_with_declared_value? false end |
.maximum_height ⇒ Object
12 13 14 |
# File 'lib/freight_kit/carriers/clni.rb', line 12 def maximum_height Measured::Length.new(105, :inches) end |
.maximum_weight ⇒ Object
16 17 18 |
# File 'lib/freight_kit/carriers/clni.rb', line 16 def maximum_weight Measured::Weight.new(10_000, :pounds) end |
.minimum_length_for_overlength_fees ⇒ Object
20 21 22 |
# File 'lib/freight_kit/carriers/clni.rb', line 20 def minimum_length_for_overlength_fees Measured::Length.new(8, :feet) end |
.overlength_fees_require_tariff? ⇒ Boolean
24 25 26 |
# File 'lib/freight_kit/carriers/clni.rb', line 24 def overlength_fees_require_tariff? false end |
.required_credential_types ⇒ Object
28 29 30 |
# File 'lib/freight_kit/carriers/clni.rb', line 28 def required_credential_types %i[api website] end |
.requirements ⇒ Object
32 33 34 |
# File 'lib/freight_kit/carriers/clni.rb', line 32 def requirements %i[credentials] end |
Instance Method Details
#pod(tracking_number) ⇒ Object
Documents
49 50 51 |
# File 'lib/freight_kit/carriers/clni.rb', line 49 def pod(tracking_number) parse_document_response(:pod, tracking_number) end |
#scanned_bol(tracking_number) ⇒ Object
53 54 55 |
# File 'lib/freight_kit/carriers/clni.rb', line 53 def scanned_bol(tracking_number) parse_document_response(:bol, tracking_number) end |
#validate_packages(packages, tariff = nil) ⇒ Object
Rates
59 60 61 62 63 |
# File 'lib/freight_kit/carriers/clni.rb', line 59 def validate_packages(packages, tariff = nil) raise UnserviceableError, 'Must be fewer than 10 items altogether' if packages.sum(&:quantity) > 10 super end |