
=head1 NAME

User::Identity::Location - physical location of a person

=head1 CLASS INHERITANCE

 User::Identity::Location
   is a User::Identity::Collection::Item

=head1 SYNOPSIS

 use User::Identity;
 use User::Identity::Location;
 my $me   = User::Identity->new(...);
 my $addr = User::Identity::Location->new(...);
 $me->add(location => $addr);

 # Simpler

 use User::Identity;
 my $me   = User::Indentity->new(...);
 my $addr = $me->add(location => ...);

=head1 DESCRIPTION

The User::Identity::Location object contains the description of a physical
location of a person: home, work, travel.  The locations are collected
by a User::Identity::Collection::Locations object.

Nearly all methods can return undef.  Some methods produce language or
country specific output.

=head1 METHODS

=head2 Initiation

=over 4

=item B<new> [NAME], OPTIONS

(Class method) 
Create a new location.  You can specify a name as first argument, or
in the OPTION list.  Without a specific name, the organization is used as name.

 OPTION               DEFAULT
 country              undef
 country_code         undef
 fax                  undef
 name                 <required>
 organization         undef
 pobox                undef
 pobox_pc             undef
 postal_code          undef
 state                undef
 street               undef
 telephone            undef
 user                 undef

=over 4

=item B<country> =E<gt> STRING

=item B<country_code> =E<gt> STRING

=item B<fax> =E<gt> STRING|ARRAY

=item B<name> =E<gt> STRING

See User::Identity::Collection::Item::new(name)

=item B<organization> =E<gt> STRING

=item B<pobox> =E<gt> STRING

=item B<pobox_pc> =E<gt> STRING

=item B<postal_code> =E<gt> STRING

=item B<state> =E<gt> STRING

=item B<street> =E<gt> STRING

=item B<telephone> =E<gt> STRING|ARRAY

=item B<user> =E<gt> OBJECT

See User::Identity::Collection::Item::new(user)

=back

=back

=head2 Attributes

=over 4

=item B<city> 

The city where the address is located.

=item B<country> 

The country where the address is located.  If the name of the country is
not known but a country code is defined, the name will be looked-up
using Geography::Countries (if installed).

=item B<countryCode> 

Each country has an ISO standard abbreviation.  Specify the country or the
country code, and the other will be filled in automatically.

=item B<fax> 

One or more fax numbers. Like the telephone() method above.

=item B<fullAddress> 

Create an address to put on a postal mailing, in the format as normal in
the country where it must go to.  To be able to achieve that, the country
code must be known.  If the city is not specified or no street or pobox is
given, undef will be returned: an incomplete address.

 print $uil->fullAddress;
 print $user->find(location => 'home')->fullAddress;

=item B<name> 

See User::Identity::Collection::Item::name()

=item B<organization> 

The organization (for instance company) which is related to this location.

=item B<pobox> 

Post Office mail box specification.  Use C<"P.O.Box 314">, not simple C<314>.

=item B<poboxPostalCode> 

The postal code related to the Post-Office mail box.  Defined by new() option
C<pobox_pc>.

=item B<postalCode> 

The postal code is very country dependent.  Also, the location of the
code within the formatted string is country dependent.

=item B<state> 

The state, which is important for some contries but certainly not for
the smaller ones.  Only set this value when you state has to appear on
printed addresses.

=item B<street> 

Returns the address of this location.  Since Perl 5.7.3, you can use
unicode in strings, so why not format the address nicely?

=item B<telephone> 

One or more phone numbers.  Please use the internation notation, which
starts with C<'+'>, for instance C<+31-26-12131>.  In scalar context,
only the first number is produced.  In list context, all numbers are
presented.

=item B<user> [USER]

See User::Identity::Collection::Item::user()

=back

=head1 SEE ALSO

See the website at L<http://perl.overmeer.net/userid/>.

=head1 AUTHOR

Written by Mark Overmeer (L<mark@overmeer.net|mailto:mark@overmeer.net>)
with the help of many.  See the ChangeLog for details.

=head1 VERSION

This code is beta, version 0.02.

Copyright (c) 2003 by the authors. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
