Youri::Package::Change - Package change class


Youri-Package documentation Contained in the Youri-Package distribution.

Index


Code Index:

NAME

Top

Youri::Package::Change - Package change class

DESCRIPTION

Top

This class represent a package change.

CLASS METHODS

Top

new(%args)

Creates and returns a new Youri::Package::Change object.

get_author()

Returns the author of this change.

get_time()

Return the time of this change.

get_raw_text()

Returns the textual description of this change, as as string.

get_text_items()

Returns the textual description of this change, as as array reference of individual changes.


Youri-Package documentation Contained in the Youri-Package distribution.
# $Id: Change.pm 1484 2007-02-18 21:10:00Z guillomovitch $
package Youri::Package::Change;

use strict;
use warnings;
use Carp;

use constant AUTHOR => 0;
use constant TIME   => 1;
use constant TEXT   => 2;

sub new {
    my ($class, $author, $time, $text) = @_;

    return bless [
        $author,
        $time,
        $text,
    ], $class;
}

sub get_author {
    my ($self) = @_;
    croak "Not a class method" unless ref $self;

    return $self->[AUTHOR];
}

sub get_time {
    my ($self) = @_;
    croak "Not a class method" unless ref $self;

    return $self->[TIME];
}

sub get_raw_text {
    my ($self) = @_;
    croak "Not a class method" unless ref $self;

    return $self->[TEXT];
}

sub get_text_items {
    my ($self) = @_;
    croak "Not a class method" unless ref $self;

    return $self->[TEXT] =~ /
                ^
                [-+ ] \s+ # list token
                (.*)      # real text
                $
                /xmg;
}

1;