Rsync::Config::Atom - atom of a rsync configuration file
0.2
Rsync::Config::Atom is the smallest element of a rsync configuration file. Every atom has a name and a value. There are 2 types of atoms with special treatment.
Rsync::Config::Atom inherits from Rsync::Config::Renderer.
use Rsync::Config::Atom; sub main { my $atom = new Rsync::Config::Atom(name => 'path', value => '/var/ftp/pub/mirrors/cpan.org'); }
Please note that some methods may throw exceptions. Check the documentation for each method to see what exceptions may be throwned.
The constructor. The constructor accepts a hash as a argument. The hash must contain 2 keys:
name can be:
In all cases name and value must be specified, except for __blank__ atoms. new may throw the following exceptions:
Also, options accepted by Rsync::Config::Renderer can be used. Check the documentation of Rsync::Config::Renderer for a complete list of options.
returns true (1) if the atom is a blank atom (empty line), 0 otherwise
returns true (1) if the atom is a comment, 0 otherwise
changes the name of the atom if $new_name is defined. Always returns the name of the atom. If this method is called outside class instance a REX::OutsideClass exception is throwned.
changes the value of the atom if $new_value is defined. Else, returns the value of the atom. If this method is called outside class instance a REX::OutsideClass exception is throwned.
returns a string representation of the atom. If this method is called outside class instance a REX::OutsideClass exception is throwned.
Rsync::Config::Atom depends on the following modules:
All tests are located in the t directory .
This module is perl critic level 1 compliant.
This module does not use any configuration files or environment variables. The used modules however may use such things. Please refer to each module man page for more information.
None known to the author
Using atoms with values 0 or undef will trigger exceptions.
Rsync::Config::Exceptions Rsync::Config::Module Rsync::Config Rsync::Config::Renderer
Subredu Manuel <diablo@packages.ro>
Copyright (C) 2006 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.
To install Rsync::Config, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rsync::Config
CPAN shell
perl -MCPAN -e shell install Rsync::Config
For more information on module installation, please visit the detailed CPAN module installation guide.