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

Curio::Declare - Provider of Curio's declarative interface.

SYNOPSIS

    use Curio::Declare;
    
    resource_method_name 'name_of_method';
    registers_resources;
    
    does_caching;
    cache_per_process;
    
    does_keys;
    allow_undeclared_keys;
    default_key 'some_key';
    key_argument 'name_of_argument';
    
    default_arguments (
        arg => 'value',
        ...
    );
    
    add_key some_key => (
        arg => 'value',
        ...
    );
    
    alias_key some_alias => 'some_key';

DESCRIPTION

This module exports a bunch of candy functions as seen used in the "SYNOPSIS" in Curio. These functions set corresponding flags and fields of the same name in Curio::Factory which are then used to define the behaviors of Curio classes and objects.

There is a one-to-one match between functions listed here to arguments and methods listed in Curio::Factory, so these functions are minimally documented. Check out the linked documentation for details.

EXPORTED FUNCTIONS

resource_method_name

    resource_method_name 'name_of_method';

See "resource_method_name" in Curio::Factory for details.

registers_resources

    registers_resources;
    registers_resources 1; # same as above
    registers_resources 0; # default value

See "registers_resources" in Curio::Factory for details.

does_caching

    does_caching;
    does_caching 1; # same as above
    does_caching 0; # default value

See "does_caching" in Curio::Factory for details.

cache_per_process

    cache_per_process;
    cache_per_process 1; # same as above
    cache_per_process 0; # default value

See "cache_per_process" in Curio::Factory for details.

does_keys

    does_keys;
    does_keys 1; # same as above
    does_keys 0; # default value

See "does_keys" in Curio::Factory for details.

allow_undeclared_keys

    allow_undeclared_keys;
    allow_undeclared_keys 1; # same as above
    allow_undeclared_keys 0; # default value

See "allow_undeclared_keys" in Curio::Factory for details.

default_key

    default_key 'some_key';

See "default_key" in Curio::Factory for details.

key_argument

    key_argument 'name_of_argument';

See "key_argument" in Curio::Factory for details.

default_arguments

    default_arguments (
        arg => 'value',
        ...
    );

See "default_arguments" in Curio::Factory for details.

add_key

    add_key some_key => (
        arg => 'value',
        ...
    );
    
    add_key 'key_without_args';

See "add_key" in Curio::Factory for details.

alias_key

    alias_key some_alias => 'some_key';

See "alias_key" in Curio::Factory for details.

COPYRIGHT AND LICENSE

Copyright (C) 2019 Aran Clary Deltac

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.