Class: Shipping::Base

Inherits:
Object
  • Object
show all
Defined in:
app/services/shipping/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'app/services/shipping/base.rb', line 65

def initialize(options = {})
  @required = []
  @services = []

  # include all provided data
  options.each do |method, value|
    instance_variable_set(:"@#{method}", value)
  end

  case options[:carrier]
  when 'fedex'
    fedex
  when 'ups'
    ups
  when 'ups_freight'
    ups_freight
  when 'purolator'
    purolator
  when nil
  else
    raise ShippingError, "unknown carrier: #{options[:carrier]}"
  end
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def address
  @address
end

#address2Object

Returns the value of attribute address2.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def address2
  @address2
end

#address3Object

Returns the value of attribute address3.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def address3
  @address3
end

#address_residentialObject

Returns the value of attribute address_residential.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def address_residential
  @address_residential
end

#attention_nameObject

Returns the value of attribute attention_name.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def attention_name
  @attention_name
end

#billing_accountObject

Returns the value of attribute billing_account.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @billing_account
end

#billing_countryObject

Returns the value of attribute billing_country.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def billing_country
  @billing_country
end

#billing_zipObject

Returns the value of attribute billing_zip.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def billing_zip
  @billing_zip
end

#ci_commentsObject

Returns the value of attribute ci_comments.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def ci_comments
  @ci_comments
end

#cityObject

Returns the value of attribute city.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def city
  @city
end

#close_report_onlyObject

Returns the value of attribute close_report_only.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def close_report_only
  @close_report_only
end

#cod_amountObject

Returns the value of attribute cod_amount.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def cod_amount
  @cod_amount
end

#cod_collection_typeObject

Returns the value of attribute cod_collection_type.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def cod_collection_type
  @cod_collection_type
end

#companyObject Also known as: name

Returns the value of attribute company.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def company
  @company
end

#countryObject

Returns the value of attribute country.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def country
  @country
end

#currency_codeObject

Returns the value of attribute currency_code.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def currency_code
  @currency_code
end

#dataObject (readonly)

Returns the value of attribute data.



14
15
16
# File 'app/services/shipping/base.rb', line 14

def data
  @data
end

#debugObject

Returns the value of attribute debug.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def debug
  @debug
end

#declared_valueObject

Returns the value of attribute declared_value.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def declared_value
  @declared_value
end

#delivery_instructionsObject

Returns the value of attribute delivery_instructions.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def delivery_instructions
  @delivery_instructions
end

#delivery_total_valueObject

Returns the value of attribute delivery_total_value.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def delivery_total_value
  @delivery_total_value
end

#descriptionObject

Returns the value of attribute description.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def description
  @description
end

#discount_priceObject

Returns the value of attribute discount_price.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def discount_price
  @discount_price
end

#dropoff_typeObject

Returns the value of attribute dropoff_type.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def dropoff_type
  @dropoff_type
end

#emailObject

Returns the value of attribute email.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def email
  @email
end

#etaObject

Returns the value of attribute eta.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def eta
  @eta
end

#export_reasonObject

Returns the value of attribute export_reason.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def export_reason
  @export_reason
end

#freight_classObject

Returns the value of attribute freight_class.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def freight_class
  @freight_class
end

#freightquote_authorization_urlObject

Returns the value of attribute freightquote_authorization_url.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def freightquote_authorization_url
  @freightquote_authorization_url
end

#freightquote_client_idObject

Returns the value of attribute freightquote_client_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def freightquote_client_id
  @freightquote_client_id
end

#freightquote_client_secretObject

Returns the value of attribute freightquote_client_secret.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def freightquote_client_secret
  @freightquote_client_secret
end

#freightquote_customer_codeObject

Returns the value of attribute freightquote_customer_code.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def freightquote_customer_code
  @freightquote_customer_code
end

#freightquote_events_urlObject

Returns the value of attribute freightquote_events_url.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def freightquote_events_url
  @freightquote_events_url
end

#freightquote_rating_urlObject

Returns the value of attribute freightquote_rating_url.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def freightquote_rating_url
  @freightquote_rating_url
end

#freightquote_shipping_urlObject

Returns the value of attribute freightquote_shipping_url.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def freightquote_shipping_url
  @freightquote_shipping_url
end

#freightquote_voiding_urlObject

Returns the value of attribute freightquote_voiding_url.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def freightquote_voiding_url
  @freightquote_voiding_url
end

#handling_instructionsObject

Returns the value of attribute handling_instructions.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def handling_instructions
  @handling_instructions
end

#has_loading_dockObject

Returns the value of attribute has_loading_dock.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def has_loading_dock
  @has_loading_dock
end

#image_typeObject

Returns the value of attribute image_type.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def image_type
  @image_type
end

#include_first_class_mail_optionsObject

Returns the value of attribute include_first_class_mail_options.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def include_first_class_mail_options
  @include_first_class_mail_options
end

#insured_valueObject

Returns the value of attribute insured_value.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def insured_value
  @insured_value
end

#is_construction_siteObject

Returns the value of attribute is_construction_site.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def is_construction_site
  @is_construction_site
end

#is_trade_showObject

Returns the value of attribute is_trade_show.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def is_trade_show
  @is_trade_show
end

#label_typeObject

Returns the value of attribute label_type.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def label_type
  @label_type
end

#limited_accessObject

Returns the value of attribute limited_access.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def limited_access
  @limited_access
end

#line_itemsObject

Returns the value of attribute line_items.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def line_items
  @line_items
end

#master_tracking_numberObject

Returns the value of attribute master_tracking_number.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def master_tracking_number
  @master_tracking_number
end

#measure_heightObject

Returns the value of attribute measure_height.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def measure_height
  @measure_height
end

#measure_lengthObject

Returns the value of attribute measure_length.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def measure_length
  @measure_length
end

#measure_unitsObject

Returns the value of attribute measure_units.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def measure_units
  @measure_units
end

#measure_widthObject

Returns the value of attribute measure_width.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def measure_width
  @measure_width
end

#media_mailObject

Returns the value of attribute media_mail.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def media_mail
  @media_mail
end

#multiple_piece_shippingObject

Returns the value of attribute multiple_piece_shipping.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def multiple_piece_shipping
  @multiple_piece_shipping
end

#negotiated_ratesObject

Returns the value of attribute negotiated_rates.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def negotiated_rates
  @negotiated_rates
end

#packageObject

Returns the value of attribute package.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def package
  @package
end

#package_countObject

Returns the value of attribute package_count.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def package_count
  @package_count
end

#package_sequence_numberObject

Returns the value of attribute package_sequence_number.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def package_sequence_number
  @package_sequence_number
end

#package_totalObject

Returns the value of attribute package_total.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def package_total
  @package_total
end

#packagesObject

Returns the value of attribute packages.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def packages
  @packages
end

#packaging_typeObject

Returns the value of attribute packaging_type.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def packaging_type
  @packaging_type
end

#pay_typeObject

Returns the value of attribute pay_type.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def pay_type
  @pay_type
end

#phoneObject

Returns the value of attribute phone.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def phone
  @phone
end

#pickup_datetimeObject

Returns the value of attribute pickup_datetime.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def pickup_datetime
  @pickup_datetime
end

#pickup_instructionsObject

Returns the value of attribute pickup_instructions.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def pickup_instructions
  @pickup_instructions
end

#plain_responseObject (readonly)

Returns the value of attribute plain_response.



14
15
16
# File 'app/services/shipping/base.rb', line 14

def plain_response
  @plain_response
end

#priceObject

Returns the value of attribute price.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def price
  @price
end

#rate_dataObject

Returns the value of attribute rate_data.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def rate_data
  @rate_data
end

#reference_number_1Object

Returns the value of attribute reference_number_1.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def reference_number_1
  @reference_number_1
end

#reference_number_2Object

Returns the value of attribute reference_number_2.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def reference_number_2
  @reference_number_2
end

#reference_number_3Object

Returns the value of attribute reference_number_3.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def reference_number_3
  @reference_number_3
end

#reference_number_code_1Object

Returns the value of attribute reference_number_code_1.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def reference_number_code_1
  @reference_number_code_1
end

#reference_number_code_2Object

Returns the value of attribute reference_number_code_2.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def reference_number_code_2
  @reference_number_code_2
end

#requiredObject (readonly)

Returns the value of attribute required.



14
15
16
# File 'app/services/shipping/base.rb', line 14

def required
  @required
end

#requires_appointmentObject

Returns the value of attribute requires_appointment.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def requires_appointment
  @requires_appointment
end

#requires_inside_deliveryObject

Returns the value of attribute requires_inside_delivery.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def requires_inside_delivery
  @requires_inside_delivery
end

#requires_liftgateObject

Returns the value of attribute requires_liftgate.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def requires_liftgate
  @requires_liftgate
end

#responseObject (readonly)

Returns the value of attribute response.



14
15
16
# File 'app/services/shipping/base.rb', line 14

def response
  @response
end

#return_to_addressObject

Returns the value of attribute return_to_address.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_address
  @return_to_address
end

#return_to_address2Object

Returns the value of attribute return_to_address2.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_address2
  @return_to_address2
end

#return_to_address3Object

Returns the value of attribute return_to_address3.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_address3
  @return_to_address3
end

#return_to_address_residentialObject

Returns the value of attribute return_to_address_residential.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_address_residential
  @return_to_address_residential
end

#return_to_attention_nameObject

Returns the value of attribute return_to_attention_name.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_attention_name
  @return_to_attention_name
end

#return_to_cityObject

Returns the value of attribute return_to_city.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_city
  @return_to_city
end

#return_to_companyObject

Returns the value of attribute return_to_company.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_company
  @return_to_company
end

#return_to_countryObject

Returns the value of attribute return_to_country.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_country
  @return_to_country
end

#return_to_emailObject

Returns the value of attribute return_to_email.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_email
  @return_to_email
end

#return_to_has_loading_dockObject

Returns the value of attribute return_to_has_loading_dock.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_has_loading_dock
  @return_to_has_loading_dock
end

#return_to_is_construction_siteObject

Returns the value of attribute return_to_is_construction_site.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_is_construction_site
  @return_to_is_construction_site
end

#return_to_is_trade_showObject

Returns the value of attribute return_to_is_trade_show.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_is_trade_show
  @return_to_is_trade_show
end

#return_to_limited_accessObject

Returns the value of attribute return_to_limited_access.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_limited_access
  @return_to_limited_access
end

#return_to_nameObject

Returns the value of attribute return_to_name.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_name
  @return_to_name
end

#return_to_phoneObject

Returns the value of attribute return_to_phone.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_phone
  @return_to_phone
end

#return_to_requires_appointmentObject

Returns the value of attribute return_to_requires_appointment.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_requires_appointment
  @return_to_requires_appointment
end

#return_to_requires_inside_deliveryObject

Returns the value of attribute return_to_requires_inside_delivery.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_requires_inside_delivery
  @return_to_requires_inside_delivery
end

#return_to_requires_liftgateObject

Returns the value of attribute return_to_requires_liftgate.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_requires_liftgate
  @return_to_requires_liftgate
end

#return_to_stateObject

Returns the value of attribute return_to_state.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_state
  @return_to_state
end

#return_to_zipObject

Returns the value of attribute return_to_zip.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def return_to_zip
  @return_to_zip
end

#rl_carriers_api_keyObject

Returns the value of attribute rl_carriers_api_key.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def rl_carriers_api_key
  @rl_carriers_api_key
end

#rl_carriers_shipping_urlObject

Returns the value of attribute rl_carriers_shipping_url.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def rl_carriers_shipping_url
  @rl_carriers_shipping_url
end

#saturday_deliveryObject

Returns the value of attribute saturday_delivery.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def saturday_delivery
  @saturday_delivery
end

#sender_addressObject

Returns the value of attribute sender_address.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_address
  @sender_address
end

#sender_address2Object

Returns the value of attribute sender_address2.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_address2
  @sender_address2
end

#sender_address3Object

Returns the value of attribute sender_address3.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_address3
  @sender_address3
end

#sender_address_residentialObject

Returns the value of attribute sender_address_residential.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_address_residential
  @sender_address_residential
end

#sender_attention_nameObject

Returns the value of attribute sender_attention_name.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_attention_name
  @sender_attention_name
end

#sender_cityObject

Returns the value of attribute sender_city.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_city
  @sender_city
end

#sender_companyObject

Returns the value of attribute sender_company.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_company
  @sender_company
end

#sender_countryObject

Returns the value of attribute sender_country.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_country
  @sender_country
end

#sender_emailObject

Returns the value of attribute sender_email.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_email
  @sender_email
end

#sender_has_loading_dockObject

Returns the value of attribute sender_has_loading_dock.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_has_loading_dock
  @sender_has_loading_dock
end

#sender_is_construction_siteObject

Returns the value of attribute sender_is_construction_site.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_is_construction_site
  @sender_is_construction_site
end

#sender_is_trade_showObject

Returns the value of attribute sender_is_trade_show.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_is_trade_show
  @sender_is_trade_show
end

#sender_limited_accessObject

Returns the value of attribute sender_limited_access.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_limited_access
  @sender_limited_access
end

#sender_nameObject

Returns the value of attribute sender_name.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_name
  @sender_name
end

#sender_phoneObject

Returns the value of attribute sender_phone.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_phone
  @sender_phone
end

#sender_requires_appointmentObject

Returns the value of attribute sender_requires_appointment.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_requires_appointment
  @sender_requires_appointment
end

#sender_requires_inside_deliveryObject

Returns the value of attribute sender_requires_inside_delivery.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_requires_inside_delivery
  @sender_requires_inside_delivery
end

#sender_requires_liftgateObject

Returns the value of attribute sender_requires_liftgate.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_requires_liftgate
  @sender_requires_liftgate
end

#sender_stateObject

Returns the value of attribute sender_state.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_state
  @sender_state
end

#sender_tax_identification_numberObject

Returns the value of attribute sender_tax_identification_number.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_tax_identification_number
  @sender_tax_identification_number
end

#sender_zipObject

Returns the value of attribute sender_zip.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def sender_zip
  @sender_zip
end

#service_codeObject

Returns the value of attribute service_code.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def service_code
  @service_code
end

#service_typeObject

Returns the value of attribute service_type.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def service_type
  @service_type
end

#servicesObject (readonly)

Returns the value of attribute services.



14
15
16
# File 'app/services/shipping/base.rb', line 14

def services
  @services
end

#ship_dateObject

Returns the value of attribute ship_date.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def ship_date
  @ship_date
end

#shipengine_api_keyObject

Returns the value of attribute shipengine_api_key.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipengine_api_key
  @shipengine_api_key
end

#shipengine_canadapost_account_idObject

Returns the value of attribute shipengine_canadapost_account_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_canadapost_account_id
end

#shipengine_canadapost_parent_account_numberObject

Returns the value of attribute shipengine_canadapost_parent_account_number.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_canadapost_parent_account_number
end

#shipengine_canpar_account_idObject

Returns the value of attribute shipengine_canpar_account_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_canpar_account_id
end

#shipengine_dhl_express_account_idObject

Returns the value of attribute shipengine_dhl_express_account_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_dhl_express_account_id
end

#shipengine_fed_ex_account_idObject

Returns the value of attribute shipengine_fed_ex_account_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_fed_ex_account_id
end

#shipengine_fed_ex_ca_account_idObject

Returns the value of attribute shipengine_fed_ex_ca_account_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_fed_ex_ca_account_id
end

#shipengine_purolator_account_idObject

Returns the value of attribute shipengine_purolator_account_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_purolator_account_id
end

#shipengine_ups_account_idObject

Returns the value of attribute shipengine_ups_account_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_ups_account_id
end

#shipengine_ups_ca_account_idObject

Returns the value of attribute shipengine_ups_ca_account_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_ups_ca_account_id
end

#shipengine_usps_account_idObject

Returns the value of attribute shipengine_usps_account_id.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def 
  @shipengine_usps_account_id
end

#shipper_addressObject

Returns the value of attribute shipper_address.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_address
  @shipper_address
end

#shipper_address2Object

Returns the value of attribute shipper_address2.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_address2
  @shipper_address2
end

#shipper_address3Object

Returns the value of attribute shipper_address3.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_address3
  @shipper_address3
end

#shipper_address_residentialObject

Returns the value of attribute shipper_address_residential.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_address_residential
  @shipper_address_residential
end

#shipper_attention_nameObject

Returns the value of attribute shipper_attention_name.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_attention_name
  @shipper_attention_name
end

#shipper_cityObject

Returns the value of attribute shipper_city.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_city
  @shipper_city
end

#shipper_companyObject

Returns the value of attribute shipper_company.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_company
  @shipper_company
end

#shipper_countryObject

Returns the value of attribute shipper_country.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_country
  @shipper_country
end

#shipper_emailObject

Returns the value of attribute shipper_email.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_email
  @shipper_email
end

#shipper_has_loading_dockObject

Returns the value of attribute shipper_has_loading_dock.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_has_loading_dock
  @shipper_has_loading_dock
end

#shipper_is_construction_siteObject

Returns the value of attribute shipper_is_construction_site.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_is_construction_site
  @shipper_is_construction_site
end

#shipper_is_trade_showObject

Returns the value of attribute shipper_is_trade_show.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_is_trade_show
  @shipper_is_trade_show
end

#shipper_limited_accessObject

Returns the value of attribute shipper_limited_access.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_limited_access
  @shipper_limited_access
end

#shipper_nameObject

Returns the value of attribute shipper_name.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_name
  @shipper_name
end

#shipper_phoneObject

Returns the value of attribute shipper_phone.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_phone
  @shipper_phone
end

#shipper_requires_appointmentObject

Returns the value of attribute shipper_requires_appointment.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_requires_appointment
  @shipper_requires_appointment
end

#shipper_requires_inside_deliveryObject

Returns the value of attribute shipper_requires_inside_delivery.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_requires_inside_delivery
  @shipper_requires_inside_delivery
end

#shipper_requires_liftgateObject

Returns the value of attribute shipper_requires_liftgate.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_requires_liftgate
  @shipper_requires_liftgate
end

#shipper_stateObject

Returns the value of attribute shipper_state.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_state
  @shipper_state
end

#shipper_zipObject

Returns the value of attribute shipper_zip.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def shipper_zip
  @shipper_zip
end

#signature_confirmationObject

Returns the value of attribute signature_confirmation.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def signature_confirmation
  @signature_confirmation
end

#skip_png_downloadObject

Returns the value of attribute skip_png_download.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def skip_png_download
  @skip_png_download
end

#skip_rate_testObject

Returns the value of attribute skip_rate_test.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def skip_rate_test
  @skip_rate_test
end

#special_instructionsObject

Returns the value of attribute special_instructions.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def special_instructions
  @special_instructions
end

#stateObject

Returns the value of attribute state.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def state
  @state
end

#tax_identification_numberObject

Returns the value of attribute tax_identification_number.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def tax_identification_number
  @tax_identification_number
end

#time_in_transitObject

Returns the value of attribute time_in_transit.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def time_in_transit
  @time_in_transit
end

#total_shipment_weightObject

Returns the value of attribute total_shipment_weight.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def total_shipment_weight
  @total_shipment_weight
end

#transaction_typeObject

Returns the value of attribute transaction_type.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def transaction_type
  @transaction_type
end

#weightObject

Returns the value of attribute weight.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def weight
  @weight
end

#weight_unitsObject

Returns the value of attribute weight_units.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def weight_units
  @weight_units
end

#zipObject

Returns the value of attribute zip.



16
17
18
# File 'app/services/shipping/base.rb', line 16

def zip
  @zip
end

Class Method Details

.state_from_zip(zip) ⇒ Object

Raises:



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'app/services/shipping/base.rb', line 109

def self.state_from_zip(zip)
  zip = zip.to_i
  {
    (99_500...99_929) => 'AK',
    (35_000...36_999) => 'AL',
    (71_600...72_999) => 'AR',
    (75_502...75_505) => 'AR',
    (85_000...86_599) => 'AZ',
    (90_000...96_199) => 'CA',
    (80_000...81_699) => 'CO',
    (6000...6999) => 'CT',
    (20_000...20_099) => 'DC',
    (20_200...20_599) => 'DC',
    (19_700...19_999) => 'DE',
    (32_000...33_999) => 'FL',
    (34_100...34_999) => 'FL',
    (30_000...31_999) => 'GA',
    (96_700...96_798) => 'HI',
    (96_800...96_899) => 'HI',
    (50_000...52_999) => 'IA',
    (83_200...83_899) => 'ID',
    (60_000...62_999) => 'IL',
    (46_000...47_999) => 'IN',
    (66_000...67_999) => 'KS',
    (40_000...42_799) => 'KY',
    (45_275...45_275) => 'KY',
    (70_000...71_499) => 'LA',
    (71_749...71_749) => 'LA',
    (1000...2799) => 'MA',
    (20_331...20_331) => 'MD',
    (20_600...21_999) => 'MD',
    (3801...3801) => 'ME',
    (3804...3804) => 'ME',
    (3900...4999) => 'ME',
    (48_000...49_999) => 'MI',
    (55_000...56_799) => 'MN',
    (63_000...65_899) => 'MO',
    (38_600...39_799) => 'MS',
    (59_000...59_999) => 'MT',
    (27_000...28_999) => 'NC',
    (58_000...58_899) => 'ND',
    (68_000...69_399) => 'NE',
    (3000...3803) => 'NH',
    (3809...3899) => 'NH',
    (7000...8999) => 'NJ',
    (87_000...88_499) => 'NM',
    (89_000...89_899) => 'NV',
    (400...599) => 'NY',
    (6390...6390) => 'NY',
    (9000...14_999) => 'NY',
    (43_000...45_999) => 'OH',
    (73_000...73_199) => 'OK',
    (73_400...74_999) => 'OK',
    (97_000...97_999) => 'OR',
    (15_000...19_699) => 'PA',
    (2800...2999) => 'RI',
    (6379...6379) => 'RI',
    (29_000...29_999) => 'SC',
    (57_000...57_799) => 'SD',
    (37_000...38_599) => 'TN',
    (72_395...72_395) => 'TN',
    (73_300...73_399) => 'TX',
    (73_949...73_949) => 'TX',
    (75_000...79_999) => 'TX',
    (88_501...88_599) => 'TX',
    (84_000...84_799) => 'UT',
    (20_105...20_199) => 'VA',
    (20_301...20_301) => 'VA',
    (20_370...20_370) => 'VA',
    (22_000...24_699) => 'VA',
    (5000...5999) => 'VT',
    (98_000...99_499) => 'WA',
    (49_936...49_936) => 'WI',
    (53_000...54_999) => 'WI',
    (24_700...26_899) => 'WV',
    (82_000...83_199) => 'WY'
  }.each do |range, state|
    return state if range.include? zip
  end

  raise ShippingError, "Invalid zip code: #{zip}"
end

Instance Method Details

#fedexObject

Initializes an instance of Shipping::FedEx with the same instance variables as the base object



90
91
92
# File 'app/services/shipping/base.rb', line 90

def fedex
  FedEx.new prepare_vars
end

#purolatorObject

Initializes an instance of Shipping::Purolator with the same instance variables as the base object



105
106
107
# File 'app/services/shipping/base.rb', line 105

def purolator
  Purolator.new prepare_vars
end

#upsObject

Initializes an instance of Shipping::Ups with the same instance variables as the base object



95
96
97
# File 'app/services/shipping/base.rb', line 95

def ups
  Ups.new prepare_vars
end

#ups_freightObject

Initializes an instance of Shipping::UpsFreight with the same instance variables as the base object



100
101
102
# File 'app/services/shipping/base.rb', line 100

def ups_freight
  UpsFreight.new prepare_vars
end