Class: Shipping::ShippingRate

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::API, ActiveModel::Attributes, ActiveModel::Validations::Callbacks, StripAttributes
Defined in:
app/services/shipping/shipping_rate.rb

Overview

Service object: shipping rate.

Class Method Summary collapse

Class Method Details

.expeditedObject



30
31
32
33
34
35
36
37
38
39
# File 'app/services/shipping/shipping_rate.rb', line 30

def self.expedited
  {
      service: 'expedited',
      per_order: 15.00,
      per_pound: 1.50,
      multiplier_ak: 2.5,
      multiplier_hi: 2.5,
      early_am: 0.0
  }
end

.priorityObject



41
42
43
44
45
46
47
48
49
50
# File 'app/services/shipping/shipping_rate.rb', line 41

def self.priority
  {
      service: 'rush',
      per_order: 25.00,
      per_pound: 2.50,
      multiplier_ak: 2.0,
      multiplier_hi: 2.0,
      early_am: 0.0
  }
end

.priority_amObject



52
53
54
55
56
57
58
59
60
61
# File 'app/services/shipping/shipping_rate.rb', line 52

def self.priority_am
  {
      service: 'rush early am',
      per_order: 25.00,
      per_pound: 2.50,
      multiplier_ak: 2.0,
      multiplier_hi: 2.0,
      early_am: 10.0
  }
end

.standardObject



18
19
20
21
22
23
24
25
26
27
28
# File 'app/services/shipping/shipping_rate.rb', line 18

def self.standard
  {
      service: 'ground',
      per_order: 8.00, # order handling is $8.00 dollars.
      per_pound: 0.50, # cost by weight handling is $0.50 ctvs.
      multiplier_ak: 4.0, # When you ship to Alaska you should multiply the total by 4.
      multiplier_hi: 5.0, # When you ship to Hawaii you should multiply the total by 5.
      per_oversize: 0.5, # the increase should be 50% when length, width or height are greater than 48 inches.
      early_am: 0.0 # additional cost if the customer wants to receive package early morning.
  }
end