The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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);