Sha256: cbe13a6769aabb3354271456b0bb5e80d7a8f69e0d43571f37e7b853ba6ee4d1
Contents?: true
Size: 458 Bytes
Versions: 9
Compression:
Stored size: 458 Bytes
Contents
class ShippingMethod < ActiveRecord::Base belongs_to :zone def calculate_shipping(shipment) return 0 unless zone.include?(shipment.address) return shipping_calculator.constantize.new.send(:calculate_shipping, shipment) end def available?(order) calculator = shipping_calculator.constantize.new return true unless calculator.respond_to?(:available?) calculator.available?(order) end end
Version data entries
9 entries across 9 versions & 2 rubygems