package Algorithm::Dependency::Item; # ABSTRACT: Implements an item in a dependency hierarchy. #pod =pod #pod #pod =head1 DESCRIPTION #pod #pod The Algorithm::Dependency::Item class implements a single item within the #pod dependency hierarchy. It's quite simple, usually created from within a source, #pod and not typically created directly. This is provided for those implementing #pod their own source. ( See L for details ). #pod #pod =head1 METHODS #pod #pod =cut use 5.005; use strict; use Algorithm::Dependency (); our $VERSION = '1.112'; ##################################################################### # Constructor #pod =pod #pod #pod =head2 new $id, @depends #pod #pod The C constructor takes as its first argument the id ( name ) of the #pod item, and any further arguments are assumed to be the ids of other items that #pod this one depends on. #pod #pod Returns a new C on success, or C #pod on error. #pod #pod =cut sub new { my $class = shift; my $id = (defined $_[0] and ! ref $_[0] and $_[0] ne '') ? shift : return undef; bless { id => $id, depends => [ @_ ] }, $class; } #pod =pod #pod #pod =head2 id #pod #pod The C method returns the id of the item. #pod #pod =cut sub id { $_[0]->{id} } #pod =pod #pod #pod =head2 depends #pod #pod The C method returns, as a list, the names of the other items that #pod this item depends on. #pod #pod =cut sub depends { @{$_[0]->{depends}} } 1; __END__ =pod =encoding UTF-8 =head1 NAME Algorithm::Dependency::Item - Implements an item in a dependency hierarchy. =head1 VERSION version 1.112 =head1 DESCRIPTION The Algorithm::Dependency::Item class implements a single item within the dependency hierarchy. It's quite simple, usually created from within a source, and not typically created directly. This is provided for those implementing their own source. ( See L for details ). =head1 METHODS =head2 new $id, @depends The C constructor takes as its first argument the id ( name ) of the item, and any further arguments are assumed to be the ids of other items that this one depends on. Returns a new C on success, or C on error. =head2 id The C method returns the id of the item. =head2 depends The C method returns, as a list, the names of the other items that this item depends on. =head1 SEE ALSO L =head1 SUPPORT Bugs may be submitted through L (or L). =head1 AUTHOR Adam Kennedy =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2003 by Adam Kennedy. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut