Class: FreightKit::SAIA

Inherits:
Carrier show all
Includes:
Rateable, Trackable
Defined in:
lib/freight_kit/carriers/saia.rb

Constant Summary collapse

REACTIVE_FREIGHT_CARRIER =
true

Constants inherited from Carrier

Carrier::BOL_NUMBER_TRACKING_URL_TEMPLATE, Carrier::NUMBERS, Carrier::ORDER_NUMBER_TRACKING_URL_TEMPLATE, Carrier::PICKUP_NUMBER_TRACKING_URL_TEMPLATE, Carrier::PO_NUMBER_TRACKING_URL_TEMPLATE, Carrier::TRACKING_NUMBER_TRACKING_URL_TEMPLATE, Carrier::VALID_BOL_NUMBER_REGEX, Carrier::VALID_ORDER_NUMBER_REGEX, Carrier::VALID_PICKUP_NUMBER_REGEX, Carrier::VALID_PO_NUMBER_REGEX, Carrier::VALID_TRACKING_NUMBER_REGEX

Class Attribute Summary collapse

Attributes inherited from Carrier

#conf, #credentials, #customer_location, #last_request, #rates_with_excessive_length_fees, #tariff, #tmpdir

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Trackable

#find_tracking_info

Methods included from Rateable

#find_rates

Methods inherited from Carrier

#available_services, #bol, bol_requires_tracking_number?, #cancel_shipment, #create_pickup, default_location, #fetch_credential, #find_estimate, #find_locations, #find_rates, #find_tracking_info, #find_tracking_number_from_pickup_number, implemented?, #initialize, maximum_address_field_length, #overlength_fee, pickup_number_is_tracking_number?, #pod, #scanned_bol, #serviceable_accessorials?, tracking_url_template, #valid_credentials?, valid_number_regex, #valid_tracking_number?

Constructor Details

This class inherits a constructor from FreightKit::Carrier

Class Attribute Details

.nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/freight_kit/carriers/saia.rb', line 11

def name
  @name
end

.scacObject (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

Returns:

  • (Boolean)


17
18
19
# File 'lib/freight_kit/carriers/saia.rb', line 17

def find_rates_with_declared_value?
  true
end

.maximum_heightObject



21
22
23
# File 'lib/freight_kit/carriers/saia.rb', line 21

def maximum_height
  Measured::Length.new(105, :inches)
end

.maximum_weightObject



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_feesObject



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

Returns:

  • (Boolean)


33
34
35
# File 'lib/freight_kit/carriers/saia.rb', line 33

def overlength_fees_require_tariff?
  false
end

.required_credential_typesObject



37
38
39
# File 'lib/freight_kit/carriers/saia.rb', line 37

def required_credential_types
  %i[api]
end

.requirementsObject



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

Raises:



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