Method: ActiveShipping::RateEstimate#add
- Defined in:
- lib/active_shipping/rate_estimate.rb
#add(package, rate = nil) ⇒ self
Adds a package to this rate estimate
114 115 116 117 118 119 |
# File 'lib/active_shipping/rate_estimate.rb', line 114 def add(package, rate = nil) cents = Package.cents_from(rate) raise ArgumentError.new("New packages must have valid rate information since this RateEstimate has no total_price set.") if cents.nil? and total_price.nil? @package_rates << {:package => package, :rate => cents} self end |