| Business-Shipping documentation | Contained in the Business-Shipping distribution. |
Business::Shipping::RateRequest::Offline - Abstract class for cost calculation.
This doesn't have very much to it. It just disables the cache feature, and has a few miscellaneous functions.
For compatibility with parent class
Cache always disabled for Offline lookups: they are so fast already, the disk I/O of a running a cache is not worth it.
$zip Input to shorten/lengthen. Usually a zip code.
Shorten to three digits. If the input doesn't have leading zeros, add them.
Daniel Browning, db@kavod.com, http://www.kavod.com/
Copyright 2003-2011 Daniel Browning <db@kavod.com>. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. See LICENSE for more info.
| Business-Shipping documentation | Contained in the Business-Shipping distribution. |
package Business::Shipping::RateRequest::Offline;
use Any::Moose; use Business::Shipping::RateRequest; use Business::Shipping::Shipment; use Business::Shipping::Package; use Business::Shipping::Logging; use version; our $VERSION = qv('400'); extends 'Business::Shipping::RateRequest'; __PACKAGE__->meta()->make_immutable();
sub perform_action { }
sub cache { return 0; }
sub make_three { my ($self, $zip) = @_; return unless $zip; trace('( ' . ($zip ? $zip : 'undef') . ' )'); $zip = substr($zip, 0, 3); while (length($zip) < 3) { $zip = "0$zip"; } return $zip; } 1; __END__