package Stats::Metric;

use strict;
use warnings;

use lib '/app/tools/common/lib';
use Common::Util;

# private attributes
my @attributes     = qw(id units revenue sales_rank);
my @xml_attributes = qw(ID Units Revenue Rank);

# --------------------------------
# Constructor
# --------------------------------
sub new {
    my $class = shift;
    my %args  = @_;

    my $self = {};
    bless( $self, $class );

    $self->_init(%args);

    return $self;
}

sub _init {
    my $self = shift;
    my %args = @_;

    # initialize properties
    map { $self->{$_} = $args{$_} || 0 } @attributes;
}

# --------------------------------
# Properties
# (units revenue);
# --------------------------------
sub ID {
    my $self = shift;
    $self->{id};
}

sub Units {
    my $self = shift;
    $self->{units};
}

sub Revenue {
    my $self = shift;
    return $self->{revenue};
}

sub Rank {
    my $self = shift;
    return $self->{sales_rank};
}

###
1;    # Play nicely.
###
