NAME

Role::NotSoTiny::Creator

VERSION

version 0.1.0

SYNOPSIS

use Role::NotSoTiny::Creator ();

my $role = Role::NotSoTiny::Creator->create_role(
  'Foo',
  methods => {
    foo => sub {...}
  },
);

# runtime equivalent of
package Foo;
use Role::Tiny;
sub foo {...}

DESCRIPTION

This module is an experiment with Role::Tiny. It illustrates how the change in Role::NotSoTiny makes easier to build functionality such as a programmatic role creator.

NAME

Role::NotSoTiny::Creator - Experiment with Role::Tiny / Create roles programmatically

METHODS

Role::NotSoTiny::Creator implements the following methods.

make_role

Role::NotSoTiny::Creator->create_role('Some::Package', methods => \%methods);

Prepares a given package as a role. This is done by promoting the package to a Role::Tiny and adding the given methods to its stash.

AUTHOR

Adriano Ferreira <ferreira@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Adriano Ferreira.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.