package NmiStats;

# Class for NMI usage statistics
# $Id: NmiStats.pm,v 1.3 2008-01-16 21:40:20 bgietzel Exp $ 

use strict;

sub new {
    my ($class) = @_;
    my $self = {
        _user    => undef,
        _project => undef,
        _url     => undef,
        _total   => undef,
        _builds  => undef,
        _tests   => undef,
        _other   => undef,
    };
    bless $self, $class;
    return $self;
}

sub user {
    my ( $self, $user ) = @_;
    $self->{_user} = $user if defined($user);
    return $self->{_user};
}

sub project {
    my ( $self, $project ) = @_;
    $self->{_project} = $project if defined($project);
    return $self->{_project};
}

sub url {
    my ( $self, $url ) = @_;
    $self->{_url} = $url if defined($url);
    return $self->{_url};
}

sub total {
    my ( $self, $total ) = @_;
    $self->{_total} = $total if defined($total);
    return $self->{_total};
}

sub builds {
    my ( $self, $builds ) = @_;
    $self->{_builds} = $builds if defined($builds);
    return $self->{_builds};
}

sub tests {
    my ( $self, $tests ) = @_;
    $self->{_tests} = $tests if defined($tests);
    return $self->{_tests};
}

sub other {
    my ( $self, $other ) = @_;
    $self->{_other} = $other if defined($other);
    return $self->{_other};
}


sub print {
    my ($self) = @_;

    printf( "User:%s  Total:%s\n\n", $self->user, $self->total );
}

1;

