package Pakket::Role::BasicPackageAttrs;
# ABSTRACT: Some helpers to print names nicely

use Moose::Role;
use Pakket::Utils qw< canonical_package_name >;

sub short_name {
    my $self = shift;
    return canonical_package_name( $self->category, $self->name );
}

sub full_name {
    my $self = shift;
    return canonical_package_name(
        $self->category, $self->name, $self->version,
    );
}

no Moose::Role;

1;

__END__

=pod

package Pakket::Role::BasicPackageAttrs;
# ABSTRACT: Some helpers to print names nicely

use Moose::Role;
use Pakket::Utils qw< canonical_package_name >;

sub short_name {
    my $self = shift;
    return canonical_package_name( $self->category, $self->name );
}

sub full_name {
    my $self = shift;
    return canonical_package_name(
        $self->category, $self->name, $self->version,
    );
}

sub id {
    my $self = shift;
    return $self->full_name;
}

no Moose::Role;

1;

__END__

=pod

Add "id" to Package and Requirement:
Add "id" to Package and Requirement:

This is currently just calling "full_name" because that's how we
determine the ID. When we introduce attributes, they will also use
attributes. Just setting the groundwork.
