Skip to content

Commit

Permalink
Documented module usage from within scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rvosa committed Jun 11, 2012
1 parent 0707e21 commit fa0772b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions cpan/api/lib/Bio/PhyloTastic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,38 @@ sub _pod2usage {
});
}

=head1 METHODS
This distribution can actually also be used within scripts or modules. The
basic idea is to invoke C<run> on a service package name, with named arguments
(i.e. key value pairs) that match those as required on the command line.
The following example of this behaviour writes the input NeXML file $infile
as NEXUS to $outfile:
Bio::PhyloTastic::BabelPhysh->run(
'-infile' => $infile,
'-deserializer' => 'nexml',
'-outfile' => $outfile,
'-serializer' => 'nexus',
);
=over
=item run
The C<run> method is a static method, i.e. called on the package, like so:
Bio::PhyloTastic::ModuleName->run(%args);
The implementation in this superclass does argument checking and input file
parsing before it dispatches the parsed data to an implementing method in the
child class called C<_run>. That implementing method returns a
L<Bio::Phylo::Project> object that is subsequently serialized here.
=back
=cut

sub run {
my $class = shift;
my %args = ( $class->_get_default_args, $class->_get_args );
Expand Down

0 comments on commit fa0772b

Please sign in to comment.