Class: FreightKit::SEFL
- Inherits:
-
Carrier
- Object
- Carrier
- FreightKit::SEFL
- Defined in:
- lib/freight_kit/carriers/sefl.rb
Constant Summary collapse
- REACTIVE_FREIGHT_CARRIER =
true- JSON_HEADERS =
{ Accept: 'application/json', charset: 'utf-8', 'Content-Type' => 'application/x-www-form-urlencoded' }.freeze
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
Class Attribute Details
.name ⇒ Object (readonly)
Returns the value of attribute name.
38 39 40 |
# File 'lib/freight_kit/carriers/sefl.rb', line 38 def name @name end |
.scac ⇒ Object (readonly)
Returns the value of attribute scac.
38 39 40 |
# File 'lib/freight_kit/carriers/sefl.rb', line 38 def scac @scac end |
Class Method Details
.find_rates_with_declared_value? ⇒ Boolean
6 7 8 |
# File 'lib/freight_kit/carriers/sefl.rb', line 6 def find_rates_with_declared_value? true end |
.maximum_height ⇒ Object
10 11 12 |
# File 'lib/freight_kit/carriers/sefl.rb', line 10 def maximum_height Measured::Length.new(105, :inches) end |
.maximum_weight ⇒ Object
14 15 16 |
# File 'lib/freight_kit/carriers/sefl.rb', line 14 def maximum_weight Measured::Weight.new(10_000, :pounds) end |
.minimum_length_for_overlength_fees ⇒ Object
18 19 20 |
# File 'lib/freight_kit/carriers/sefl.rb', line 18 def minimum_length_for_overlength_fees Measured::Length.new(8, :feet) end |
.overlength_fees_require_tariff? ⇒ Boolean
22 23 24 |
# File 'lib/freight_kit/carriers/sefl.rb', line 22 def overlength_fees_require_tariff? false end |
.required_credential_types ⇒ Object
26 27 28 |
# File 'lib/freight_kit/carriers/sefl.rb', line 26 def required_credential_types %i[api] end |
.requirements ⇒ Object
30 31 32 |
# File 'lib/freight_kit/carriers/sefl.rb', line 30 def requirements %i[credentials] end |
Instance Method Details
#find_rates(shipment:) ⇒ Object
Rates
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/freight_kit/carriers/sefl.rb', line 52 def find_rates(shipment:) begin validate_packages(shipment.packages) rescue UnserviceableError => e return RateResponse.new(error: e) end request = build_rate_request(shipment:) parse_rate_response(shipment:, response: commit(request)) end |