NAME

Statocles::Person - Information about a person, including name and e-mail

VERSION

version 0.098

SYNOPSIS

# site.yml
site:
    $class: Statocles::Site
    author:
        $class: Statocles::Person
        name: Doug Bell
        email: doug@example.com

# Perl code
my $person = Statocles::Person->new(
    name => 'Doug Bell',
    email => 'doug@example.com',
);

DESCRIPTION

This class stores information about a person, most commonly an author of a site or a document.

This class can parse plain strings like Doug Bell <doug@example.com> into an object with name and e-mail set correctly.

Person objects stringify into the name field, for backwards-compatibility.

ATTRIBUTES

name

The author's name. Required.

email

The author's email. Optional.

METHODS

new

my $person = Statocles::Person->new(
    name => 'Doug Bell',
    email => 'doug@example.com',
);

my $person = Statocles::Person->new( 'Doug Bell <doug@example.com>' );

Construct a new Person object. Arguments can be a list of name/value pairs, or a single string with the format Name <email@domain> (the e-mail part is optional).

SEE ALSO

"author" in Statocles::Document
"author" in Statocles::Site

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.