README
1In object oriented abstractions you often model real things as Perl classes.
2Unfortunately, the Perl classes have uglier names than the real things do.
3
4For example, I might model a customer using a Foo::Customer class.
5
6It would be useful if the Foo::Customer class knew what I would call its
7associated real thing.
8
9UNIVERSAL::moniker enables classes to make a good guess at what they would be
10called in the real world.
11
12 Foo::User->moniker eq "user";
13
14 my $a = Big::Scary::Animal->new;
15 $c->moniker eq "animal";
16
17 my $o = Cephalopod::Octopus->new;
18 $o->plural_moniker eq "octopuses";
19
20==============================================================================
21
22NAME
23 UNIVERSAL::moniker
24
25SYNOPSIS
26 use UNIVERSAL::moniker;
27
28DESCRIPTION
29 Class names in Perl often don't sound great when spoken, or look good
30 when written in prose. For this reason, we tend to say things like
31 "customer" or "basket" when we are referring to
32 "My::Site::User::Customer" or "My::Site::Shop::Basket". We thought it
33 would be nice if our classes knew what we would prefer to call them.
34
35 This module will add a "moniker" (and "plural_moniker") method to
36 "UNIVERSAL", and so to every class or module.
37
38 moniker
39 $ob->moniker;
40
41 Returns the moniker for $ob. So, if $ob->isa("Big::Scary::Animal"),
42 "moniker" will return "animal".
43
44 plural_moniker
45 $ob->plural_moniker;
46
47 Returns the plural moniker for $ob. So, if
48 $ob->isa("Cephalopod::Octopus"), "plural_moniker" will return
49 "octopuses".
50
51 (You need to install Lingua::EN::Inflect for this to work.)
52
53AUTHORS
54 Marty Pauley <marty+perl@kasei.com>, Tony Bowden <tony@kasei.com>,
55 Elizabeth Mattijsen <liz@dijkmat.nl>
56
57 (Yes, 3 authors for such a small module!)
58
59COPYRIGHT
60 Copyright (C) 2004 Kasei
61
62 This program is free software; you can redistribute it under the same terms as
63 Perl.
64
65 This program is distributed in the hope that it will be useful, but WITHOUT
66 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
67 FOR A PARTICULAR PURPOSE.
68
69