This is an abstract role which provides an alternate constructor for creating
objects using parameters passed in from a configuration file. The
actual implementation of reading the configuration file is left to
-concrete subroles.
+concrete sub-roles.
It declares an attribute C<configfile> and a class method C<new_with_config>,
and requires that concrete roles derived from it implement the class method
C<get_config_from_file>.
-Attributes specified directly as arguments to C<new_with_config> supercede those
+Attributes specified directly as arguments to C<new_with_config> supersede those
in the configfile.
L<MooseX::Getopt> knows about this abstract role, and will use it if available
-to load attributes from the file specified by the commandline flag C<--configfile>
+to load attributes from the file specified by the command line flag C<--configfile>
during its normal C<new_with_options>.
=head1 Attributes
=head2 configfile
-This is a L<Path::Tiny> object which can be coerced from a regular pathname
+This is a L<Path::Tiny> object which can be coerced from a regular path
string or any object that supports stringification.
This is the file your attributes are loaded from. You can add a default
configfile in the consuming class and it will be honored at the appropriate time
my $foo = SomeClass->new_with_config(configfile => '/etc/foo.yaml');
-Explicit arguments will overide anything set by the configfile.
+Explicit arguments will override anything set by the configfile.
=head2 get_config_from_file
-This class method is not implemented in this role, but it is required of all subroles.
-Its two arguments are the classname and the configfile, and it is expected to return
+This class method is not implemented in this role, but it is required of all
+classes or roles that consume this role.
+Its two arguments are the class name and the configfile, and it is expected to return
a hashref of arguments to pass to C<new()> which are sourced from the configfile.
=head1 COPYRIGHT