Class: ReactiveShipping::CTBV

Inherits:
CarrierLogistics show all
Defined in:
lib/reactive_freight/carriers/ctbv.rb

Constant Summary collapse

REACTIVE_FREIGHT_CARRIER =
true
@@name =
'The Custom Companies'
@@scac =
'CTBV'

Instance Attribute Summary

Attributes inherited from Platform

#conf

Attributes inherited from Carrier

#conf, #rates_with_excessive_length_fees

Instance Method Summary collapse

Methods inherited from CarrierLogistics

#build_rate_params, #build_url, #commit, #debug?, #find_bol, #find_pod, #find_rates, #find_tracking_info, #parse_city_state, #parse_city_state_zip, #parse_date, #parse_document_response, #parse_rate_response, #parse_tracking_response

Methods inherited from Platform

#find_bol, #find_estimate, #find_pod, #initialize

Methods inherited from Carrier

#find_bol, #find_estimate, #find_pod, #initialize, #maximum_weight, #serviceable_accessorials?

Constructor Details

This class inherits a constructor from ReactiveShipping::Platform

Instance Method Details

#build_calculated_accessorials(packages) ⇒ Object

Rates



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/reactive_freight/carriers/ctbv.rb', line 14

def build_calculated_accessorials(packages, *)
  accessorials = []

  longest_dimension = packages.inject([]) { |_arr, p| [p.length(:in), p.width(:in)] }.max.ceil
  if longest_dimension > 144
    accessorials << '&OL=yes'
  elsif longest_dimension >= 96 && longest_dimension <= 144
    accessorials << '&OL1=yes'
  end

  accessorials
end