Class: Shipping::ShippingItem

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

Overview

Service object: shipping item.

Instance Method Summary collapse

Instance Method Details

#oversize?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
# File 'app/services/shipping/shipping_item.rb', line 16

def oversize?
  return false if sku == 'TBS-KIT' # this sku has by default a length of 48 inches but this one is divided what means it has a different length

  shipping_length >= 48 || shipping_width >= 48 || shipping_height >= 48
end

#weight_per_qtyObject



22
23
24
# File 'app/services/shipping/shipping_item.rb', line 22

def weight_per_qty
  qty_shipped * base_weight
end