app/models/concerns/spree/shipment_provider/active_shipping.rb
# Return an ActiveShipping::Package which we will estimate with and generate
# a label for. This information is based on the package_type and
# package/shipment given to the initializer
Return an ActiveShipping::Package which we will estimate with and generate
a label for. This information is based on the package_type and
package/shipment given to the initializer
Return an ActiveShipping :: Package which we will estimate with and generate a label for . This information is based on the package_type and package / shipment given to the initializer
def package_for_label
      return @package_for_label if defined? @package_for_label
      insurance = @package.try(:insurance).try :to_s
      insurance = nil if insurance == '0'
      insurance = nil unless @package.try(:insurance_enabled?)
      @package_for_label = ::ActiveShipping::Package.new @package.weight_in_oz,
        [@package_type.length, @package_type.width, @package_type.height],
        units: :imperial, package_type: package_type_code(@package_type.provider_type),
        value: insurance
    end
def package_for_label return @package_for_label if defined? @package_for_label insurance = @package . try ( :insurance ) . try :to_s insurance = nil if insurance == '0' insurance = nil unless @package . try ( :insurance_enabled? ) @package_for_label = :: ActiveShipping :: Package . new @package . weight_in_oz , [ @package_type . length , @package_type . width , @package_type . height ] , units : :imperial , package_type : package_type_code ( @package_type . provider_type ) , value : insurance end
Return an ActiveShipping::Package which we will estimate with and generate
a label for.
Return an ActiveShipping :: Package which we will estimate with and generate a label for .