<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Role::Tiny - Roles. Like a nouvelle cuisine portion size slice of Moose.

SYNOPSIS
     package Some::Role;

     use Role::Tiny;

     sub foo { ... }

     sub bar { ... }

     around baz =&gt; sub { ... }

     1;

    else where

     package Some::Class;

     use Role::Tiny::With;

     # bar gets imported, but not foo
     with 'Some::Role';

     sub foo { ... }

     # baz is wrapped in the around modifier by Class::Method::Modifiers
     sub baz { ... }

     1;

    If you wanted attributes as well, look at Moo::Role.

DESCRIPTION
    "Role::Tiny" is a minimalist role composition tool.

ROLE COMPOSITION
    Role composition can be thought of as much more clever and meaningful
    multiple inheritance. The basics of this implementation of roles is:

    * If a method is already defined on a class, that method will not be
      composed in from the role.

    * If a method that the role "requires" to be implemented is not
      implemented, role application will fail loudly.

    Unlike Class::C3, where the last class inherited from "wins," role
    composition is the other way around, where first wins. In a more
    complete system (see Moose) roles are checked to see if they clash. The
    goal of this is to be much simpler, hence disallowing composition of
    multiple roles at once.

METHODS
  apply_role_to_package
     Role::Tiny-&gt;apply_role_to_package('Some::Package', 'Some::Role');

    Composes role with package. See also Role::Tiny::With.

  apply_roles_to_object
     Role::Tiny-&gt;apply_roles_to_object($foo, qw(Some::Role1 Some::Role2));

    Composes roles in order into object directly. Object is reblessed into
    the resulting class.

  create_class_with_roles
     Role::Tiny-&gt;create_class_with_roles('Some::Base', qw(Some::Role1 Some::Role2));

    Creates a new class based on base, with the roles composed into it in
    order. New class is returned.

SUBROUTINES
  does_role
     if (Role::Tiny::does_role($foo, 'Some::Role')) {
       ...
     }

    Returns true if class has been composed with role.

    This subroutine is also installed as -&gt;does on any class a Role::Tiny is
    composed into unless that class already has an -&gt;does method, so

      if ($foo-&gt;does('Some::Role')) {
        ...
      }

    will work for classes but to test a role, one must use ::does_role
    directly

IMPORTED SUBROUTINES
  requires
     requires qw(foo bar);

    Declares a list of methods that must be defined to compose role.

  with
     with 'Some::Role1';
     with 'Some::Role2';

    Composes another role into the current role. Only one role may be
    composed in at a time to allow the code to remain as simple as possible.

  before
     before foo =&gt; sub { ... };

    See "before method(s) =&gt; sub { ... }" in Class::Method::Modifiers for
    full documentation.

    Note that since you are not required to use method modifiers,
    Class::Method::Modifiers is lazily loaded and we do not declare it as a
    dependency. If your Role::Tiny role uses modifiers you must depend on
    both Class::Method::Modifiers and Role::Tiny.

  around
     around foo =&gt; sub { ... };

    See "around method(s) =&gt; sub { ... }" in Class::Method::Modifiers for
    full documentation.

    Note that since you are not required to use method modifiers,
    Class::Method::Modifiers is lazily loaded and we do not declare it as a
    dependency. If your Role::Tiny role uses modifiers you must depend on
    both Class::Method::Modifiers and Role::Tiny.

  after
     after foo =&gt; sub { ... };

    See "after method(s) =&gt; sub { ... }" in Class::Method::Modifiers for
    full documentation.

    Note that since you are not required to use method modifiers,
    Class::Method::Modifiers is lazily loaded and we do not declare it as a
    dependency. If your Role::Tiny role uses modifiers you must depend on
    both Class::Method::Modifiers and Role::Tiny.

SEE ALSO
    Role::Tiny is the attribute-less subset of Moo::Role; Moo::Role is a
    meta-protocol-less subset of the king of role systems, Moose::Role.

    If you don't want method modifiers and do want to be forcibly restricted
    to a single role application per class, Ovid's Role::Basic exists. But
    Stevan Little (the Moose author) and I are both still convinced that
    he's Doing It Wrong.

AUTHOR
    mst - Matt S. Trout (cpan:MSTROUT) &lt;mst@shadowcat.co.uk&gt;

CONTRIBUTORS
    dg - David Leadbeater (cpan:DGL) &lt;dgl@dgl.cx&gt;

    frew - Arthur Axel "fREW" Schmidt (cpan:FREW) &lt;frioux@gmail.com&gt;

    hobbs - Andrew Rodland (cpan:ARODLAND) &lt;arodland@cpan.org&gt;

    jnap - John Napiorkowski (cpan:JJNAPIORK) &lt;jjn1056@yahoo.com&gt;

    ribasushi - Peter Rabbitson (cpan:RIBASUSHI) &lt;ribasushi@cpan.org&gt;

    chip - Chip Salzenberg (cpan:CHIPS) &lt;chip@pobox.com&gt;

    ajgb - Alex J. G. BurzyĹski (cpan:AJGB) &lt;ajgb@cpan.org&gt;

    doy - Jesse Luehrs (cpan:DOY) &lt;doy at tozt dot net&gt;

    perigrin - Chris Prather (cpan:PERIGRIN) &lt;chris@prather.org&gt;

COPYRIGHT
    Copyright (c) 2010-2012 the Role::Tiny "AUTHOR" and "CONTRIBUTORS" as
    listed above.

LICENSE
    This library is free software and may be distributed under the same
    terms as perl itself.

</pre></body></html>