NAME

Business::cXML::Address::Number - cXML contact phone/fax number

SYNOPSIS

use Business::cXML::Address::Number;

DESCRIPTION

Object representation of a cXML phone or fax number. You can specify which when calling new() by passing $node set to Phone (default) or Fax. Alternatively, you can also specify it with a _nodeName in new()'s $properties.

Specifically not implemented are Faxes containing a URL or e-mail address instead of a telephone number.

METHODS

See "COMMON METHODS" in Business::cXML::Object, plus the following:

toString()

Returns the string representation of the phone number in C-AAA-NNN-NNNN format, without the extension. Only North-American formatting is currently implemented.

fromString( $string )

Extracts country code, area code and number from $string. (Not the extension.) Non-numeric characters are safely discarded. Only North-American formatting is currently implemented, with the benefit that the initial 1 is optional.

Note: processing starts from the left, so any custom extension suffixes are safely ignored.

PROPERTY METHODS

See "PROPERTY METHODS" in Business::cXML::Object for how the following operate.

name

Optional, name of this phone or fax number (i.e. work). Without a name, this represents a TelephoneNumber without a wrapper Phone/Fax.

country_iso

2-letter ISO country code

country_code

Country code (default: 1)

area_code

Area code

number

Number

extension

Optional, extension

AUTHOR

Stéphane Lavergne https://github.com/vphantom

ACKNOWLEDGEMENTS

Graph X Design Inc. https://www.gxd.ca/ sponsored this project.

COPYRIGHT & LICENSE

Copyright (c) 2017-2018 Stéphane Lavergne https://github.com/vphantom

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.