lib/friendly_shipping/rate.rb in friendly_shipping-0.2.3 vs lib/friendly_shipping/rate.rb in friendly_shipping-0.2.4
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module FriendlyShipping
class Rate
class NoAmountsGiven < StandardError; end
attr_reader :shipping_method,
:amounts,
@@ -33,9 +35,10 @@
@original_response = original_response
end
def total_amount
raise NoAmountsGiven if amounts.empty?
+
amounts.map { |_name, amount| amount }.sum
end
end
end