NAME

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

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