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

Function::Interface::Info - information about interface package

SYNOPSIS

package IFoo {
    use Function::Interface;

    fun hello(Str $msg) :Return(Str);
}

my $info = Function::Interface::info 'IFoo';
$info->package;   # IFoo
$info->functions; # [ Function::Interface::Info::Function ]

for my $finfo (@{$info->functions}) {
    $finfo->subname; # hello
    $finfo->keyword; # fun
    $finfo->params;  # [ Function::Interface::Info::Function::Param ]
    $finfo->return;  # [ Function::Interface::Info::Function::ReturnParam ]

    for my $pinfo (@{$finfo->params}) {
        $pinfo->type;     # Str
        $pinfo->name;     # $msg
        $pinfo->named;    # false
        $pinfo->optional; # false
    }

    for my $rinfo (@{$rinfo->return}) {
        $rinfo->type; # Str
    }
}

DESCRIPTION

Function::Interface::info returns objects of this class to describe interface package.

METHODS

new

Constructor of Function::Interface::Info. This is usually called at Function::Interface::info.

$info->package

Returns interface package name

$info->functions

Returns a list of Function::Interface::Info::Function

SEE ALSO

Function::Interface