Class: FreightKit::SAIA
- Inherits:
-
Carrier
- Object
- Carrier
- FreightKit::SAIA
- Defined in:
- lib/freight_kit/carriers/saia.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
- .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
Methods included from Trackable
Methods included from Rateable
Class Attribute Details
.name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/freight_kit/carriers/saia.rb', line 11 def name @name end |
.scac ⇒ Object (readonly)
Returns the value of attribute scac.
11 12 13 |
# File 'lib/freight_kit/carriers/saia.rb', line 11 def scac @scac end |
Class Method Details
.find_rates_with_declared_value? ⇒ Boolean
17 18 19 |
# File 'lib/freight_kit/carriers/saia.rb', line 17 def find_rates_with_declared_value? true end |
.maximum_height ⇒ Object
21 22 23 |
# File 'lib/freight_kit/carriers/saia.rb', line 21 def maximum_height Measured::Length.new(105, :inches) end |
.maximum_weight ⇒ Object
25 26 27 |
# File 'lib/freight_kit/carriers/saia.rb', line 25 def maximum_weight Measured::Weight.new(10_000, :pounds) end |
.minimum_length_for_overlength_fees ⇒ Object
29 30 31 |
# File 'lib/freight_kit/carriers/saia.rb', line 29 def minimum_length_for_overlength_fees Measured::Length.new(8, :feet) end |
.overlength_fees_require_tariff? ⇒ Boolean
33 34 35 |
# File 'lib/freight_kit/carriers/saia.rb', line 33 def overlength_fees_require_tariff? false end |
.required_credential_types ⇒ Object
37 38 39 |
# File 'lib/freight_kit/carriers/saia.rb', line 37 def required_credential_types %i[api] end |
.requirements ⇒ Object
41 42 43 |
# File 'lib/freight_kit/carriers/saia.rb', line 41 def requirements %i[credentials] end |
Instance Method Details
#validate_packages(packages, _tariff = nil) ⇒ Object
Rates
50 51 52 53 54 |
# File 'lib/freight_kit/carriers/saia.rb', line 50 def validate_packages(packages, _tariff = nil) raise UnserviceableError, 'Must be fewer than 10 items altogether' if packages.sum(&:quantity) > 10 super end |