NAME

Curio::Role - Role for Curio classes.

DESCRIPTION

This Moo::Role provides various shortcut methods for interacting witht the underlying Curio::Factory object.

CLASS METHODS

fetch

my $curio = Some::Curio::Class->fetch();
my $curio = Some::Curio::Class->fetch( $key );

This proxies to "fetch_curio" in Curio::Factory.

find_curio

my $curio_object = MyApp::Service::Cache->find_curio( $resource );

This proxies to "find_curio" in Curio::Factory.

inject

MyApp::Service::Cache->inject( $curio_object );
MyApp::Service::Cache->inject( $key, $curio_object );

This proxies to "inject" in Curio::Factory.

inject_with_guard

my $guard = MyApp::Service::Cache->inject_with_guard(
    $curio_object,
);

my $guard = MyApp::Service::Cache->inject_with_guard(
    $key, $curio_object,
);

This proxies to "inject_with_guard" in Curio::Factory.

clear_injection

my $curio_object = MyApp::Service::Cache->clear_injection();
my $curio_object = MyApp::Service::Cache->clear_injection( $key );

This proxies to "clear_injection" in Curio::Factory.

injection

my $curio_object = MyApp::Service::Cache->injection();
my $curio_object = MyApp::Service::Cache->injection( $key );

This proxies to "injection" in Curio::Factory.

has_injection

if (MyApp::Service::Cache->has_injection()) { ... }
if (MyApp::Service::Cache->has_injection( $key )) { ... }

This proxies to "has_injection" in Curio::Factory.

initialize

Sets up your class's Curio::Factory object and is automatically called when you use Curio;. This is generally not called directly by end-user code.

CLASS ATTRIBUTES

factory

my $factory = MyApp::Service::Cache->factory();

Returns the class's Curio::Factory object.

declared_keys

my $keys = MyApp::Service::Cache->declared_keys();
foreach my $key (@$keys) { ... }

This proxies to "declared_keys" in Curio::Factory.

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/.