1Perl::Critic::PolicyFacUtsoerry(C3o)ntributed Perl DocumPeenrtla:t:iCornitic::PolicyFactory(3)
2
3
4

NAME

6       Perl::Critic::PolicyFactory - Instantiate Policy objects
7

DESCRIPTION

9       This is a helper class that instantiates Perl::Critic::Policy objects
10       with the user's preferred parameters. There are no user-serviceable
11       parts here.
12

CONSTRUCTOR

14       "new( -profile => $profile"
15               Returns a reference to a new Perl::Critic::PolicyFactory
16               object.
17
18               -profile is a reference to a Perl::Critic::UserProfile object.
19               This argument is required.
20

METHODS

22       "create_policy( -name => $policy_name, -params => \%param_hash )"
23               Creates one Policy object.  If the object cannot be instanti‐
24               ated, it will throw a fatal exception.  Otherwise, it returns a
25               reference to the new Policy object.
26
27               -name is the name of a Perl::Critic::Policy subclass module.
28               The 'Perl::Critic::Policy' portion of the name can be omitted
29               for brevity.  This argument is required.
30
31               -params is an optional reference to hash of parameters that
32               will be passed into the constructor of the Policy.  If
33               "-params" is not defined, we will use the appropriate Policy
34               parameters from the Perl::Critic::UserProfile.
35
36       " create_all_policies() "
37               Constructs and returns one instance of each Perl::Critic::Pol‐
38               icy subclass that is installed on the local system.  Each Pol‐
39               icy will be created with the appropriate parameters from the
40               user's configuration profile.
41

SUBROUTINES

43       Perl::Critic::PolicyFactory has a few static subroutines that are used
44       internally, but may be useful to you in some way.
45
46       "site_policy_names()"
47               Returns a list of all the Policy modules that are currently
48               installed in the Perl::Critic:Policy namespace.  These will
49               include modules that are distributed with Perl::Critic plus any
50               third-party modules that have been installed.
51

AUTHOR

53       Jeffrey Ryan Thalhammer <thaljef@cpan.org>
54
56       Copyright (c) 2005-2007 Jeffrey Ryan Thalhammer.  All rights reserved.
57
58       This program is free software; you can redistribute it and/or modify it
59       under the same terms as Perl itself.  The full text of this license can
60       be found in the LICENSE file included with this module.
61
62
63
64perl v5.8.8                       2007-03-20    Perl::Critic::PolicyFactory(3)
Impressum