File: README

package info (click to toggle)
librole-commons-perl 0.104-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 196 kB
  • ctags: 21
  • sloc: perl: 247; makefile: 17
file content (95 lines) | stat: -rw-r--r-- 2,868 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
NAME
    Role::Commons - roles that can be commonly used, for the mutual benefit of
    all

SYNOPSIS
     use 5.010;
 
     {
       package Local::Class;
       use Moo;
       use Role::Commons -all;
       our $AUTHORITY = 'cpan:JOEBLOGGS';
       our $VERSION   = '1.000';
     }
 
     say Local::Class->AUTHORITY
       if Local::Class->DOES('Role::Commons::Authority');
 
     my $obj = Local::Class->new;
     say $obj->object_id
       if $obj->DOES('Role::Commons::ObjectID');

DESCRIPTION
    Role-Commons is not yet another implementation of roles. It is a
    collection of generic, reusable roles that hopefully you will love to
    apply to your classes. These roles are built using Moo::Role, so
    automatically integrate into the Moose object system if you're using it,
    but they do not require Moose.

    The Role::Commons module itself provides shortcuts for applying roles to
    your package, so that instead of doing:

     {
       package Local::Class;
   
       use Moo;  # or "use Moose"
       with qw( Role::Commons::Authority Role::Commons::ObjectID );
     }

    You can just do this:

     {
       package Local::Class;
   
       use Moo;
       use Role::Commons qw( Authority ObjectID );
     }

    It also handles passing some simple parameters through to the role from
    the consuming class. (Because Moo doesn't have anything like
    MooseX::Role::Parameterized.)

  Roles
    Role::Commons::Authority
        Sets up a `AUTHORITY` method for your class which is conceptually a
        little like `VERSION`.

    Role::Commons::ObjectID
        Provides an `object_id` method for your class which returns a unique
        identifier for each object.

    Role::Commons::Tap
        Provides a `tap` method for your class, inspired by Ruby's method of
        the same name. Helpful for writing chained method calls.

  Obsolescence
    Role-Commons is the successor for my older projects: authority-shared,
    Object-AUTHORITY, Object-DOES, Object-Role, and Object-Tap.

    Role-Commons bundles Object::AUTHORITY for the sake of backwards
    compatibility. This is being phased out.

BUGS
    Please report any bugs to
    <http://rt.cpan.org/Dist/Display.html?Queue=Role-Commons>.

SEE ALSO
    Role::Commons::Authority, Role::Commons::ObjectID, Role::Commons::Tap.

    Role::Tiny, Moo::Role, Moose::Role.

AUTHOR
    Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE
    This software is copyright (c) 2012, 2014 by Toby Inkster.

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

DISCLAIMER OF WARRANTIES
    THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
    WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
    MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.