NAME

Raisin::Attributes - Simple attributes accessors for Raisin.

SYNOPSIS

use Raisin::Attributes;

has 'new';
say $self->new; # -> undef

has key => 'value';
say $self->key; # -> value

DESCRIPTION

Simple implementation of attribute accessors.

METHODS

has

This code:

has key => 'value';

Will produce:

sub key {
    my ($self, $value) = @_;
    $self->{key} = $value if defined $value;
    return $self->{key} // 'value';
}