NAME
Business::UPS::Tracking::Utils - Utility functions
SYNOPSIS
use Business::UPS::Tracking::Utils;
DESCRIPTION
This module provides some basic utility functions for Business::UPS::Tracking and defines some Moose type constraints and coercions as well as the exception classes.
FUNCTIONS
parse_date
$datetime = parse_date($string);
Parses a date string (YYYYMMDD) and returns a DateTime object.
parse_time
$datetime = parse_time($string,$datetime);
Parses a time string (HHMMSS) and appends the parsed values to the given DateTime object
build_address
my $address = build_address($libxml_node,$xpath_expression);
Turns an address xml node into a Business::UPS::Tracking::Element::Address object.
build_weight
my $weight = build_weight($libxml_node,$xpath_expression);
Turns an weight xml node into a Business::UPS::Tracking::Element::Weight object.
build_referencenumber
my $weight = build_referencenumber($libxml_node,$xpath_expression);
Turns an weight xml node into a Business::UPS::Tracking::Element::ReferenceNumber object.
escape_xml
my $escaped_string = escape_xml($string);
Escapes a string for xml