NAME

Raisin::Types::Base - Base class for Raisin::Types.

SYNOPSIS

my $Price =
    Raisin::Types::Base->new(
        check => sub {
            my $v = shift;
            return if ref $v;
            $v =~ /^[\d.]*$/;
        },
        in => sub {
            my $v = shift; # SCALAR REF
            $$v = sprintf '%.2f', $$v;
        },
    );

DESCRIPTION

Base class for each Raisin type.

Contains two base methods: check and in.

METHODS

check

Check value.

$Price->check(\$value);

in

Apply some actions on the value.

$Price->in(\$value);