logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Software::Copyright::Owner - Copyright owner class

Author

       Dominique Dumont

Constructor

       The constructor can be called without argument or with a string containing a name and an optional email
       address. E.g:

        my $owner = Software::Copyright::Owner->new();
        my $owner = Software::Copyright::Owner->new('Joe');
        my $owner = Software::Copyright::Owner->new('Joe <joe@example.com>');

       It can also be called with copyright assignment involving more than one person. See synopsis for details.

Description

       This class holds the name and email of a copyright holder.

Methods

name
       Set or get owner's name. Note that names with Unicode characters are normalized to Canonical Composition
       (NFC). Name can be empty when the copyright owners has more that one name (i.e. "John Doe and Jane Doe")
       or if the string passed to new() contains unexpected information (like a year).

   record
       Set or get the record of a copyright. The record is set by constructor when the owner contains more than
       one name or if the owner contains unexpected information.

   identifier
       Returns "name" or "record".

   email
       Set or get owner's email

   stringify
       Returns a string containing name (or record) and email (if any) of the copyright owner.

   Operatoroverload
       Operator "" is overloaded to call "stringify".

Name

       Software::Copyright::Owner - Copyright owner class

Synopsis

        use Software::Copyright::Owner;

        # one owner
        my $owner = Software::Copyright::Owner->new('Joe <joe@example.com>');

        $owner->name; # => is "Joe"
        $owner->email; # => is 'joe@example.com'
        $owner->identifier; # => is 'Joe'

        # stringification
        my $s = "$owner"; # => is 'Joe <joe@example.com>'

        # several owners, separated by "and" or ","
        my $owner2 = Software::Copyright::Owner->new('Joe <joe@example.com>, William, Jack and Averell');

        $owner2->name; # => is undef
        $owner2->email; # => is undef
        $owner2->record; # => is 'Joe <joe@example.com>, William, Jack and Averell'
        $owner2->identifier; # => is 'Joe <joe@example.com>, William, Jack and Averell'

        # stringification
        $s = "$owner2"; # => is 'Joe <joe@example.com>, William, Jack and Averell'

Version

       version 0.015

See Also