| 1 | package Parse::MediaWikiDump::link; | ||
| 2 | |||
| 3 | our $VERSION = '1.0.3'; | ||
| 4 | |||
| 5 | #you must pass in a fully populated link array reference | ||
| 6 | sub new { | ||
| 7 | my ($class, $self) = @_; | ||
| 8 | |||
| 9 | bless($self, $class); | ||
| 10 | |||
| 11 | return $self; | ||
| 12 | } | ||
| 13 | |||
| 14 | sub from { | ||
| 15 | my ($self) = @_; | ||
| 16 | return $$self[0]; | ||
| 17 | } | ||
| 18 | |||
| 19 | sub namespace { | ||
| 20 | my ($self) = @_; | ||
| 21 | return $$self[1]; | ||
| 22 | } | ||
| 23 | |||
| 24 | sub to { | ||
| 25 | my ($self) = @_; | ||
| 26 | return $$self[2]; | ||
| 27 | } | ||
| 28 | |||
| 29 | 1; | ||
| 30 | |||
| 31 | =head1 NAME | ||
| 32 | |||
| 33 | Parse::MediaWikiDump::link - Object representing a link from one article to another | ||
| 34 | |||
| 35 | =head1 ABOUT | ||
| 36 | |||
| 37 | This object is used to access the data associated with each individual link between articles in a MediaWiki instance. | ||
| 38 | |||
| 39 | =head1 STATUS | ||
| 40 | |||
| 41 | This software is being RETIRED - MediaWiki::DumpFile is the official successor to | ||
| 42 | Parse::MediaWikiDump and includes a compatibility library called MediaWiki::DumpFile::Compat | ||
| 43 | that is 100% API compatible and is a near perfect standin for this module. It is faster | ||
| 44 | in all instances where it counts and is actively maintained. Any undocumented deviation | ||
| 45 | of MediaWiki::DumpFile::Compat from Parse::MediaWikiDump is considered a bug and will | ||
| 46 | be fixed. | ||
| 47 | |||
| 48 | =head1 METHODS | ||
| 49 | |||
| 50 | =over 4 | ||
| 51 | |||
| 52 | =item $link->from | ||
| 53 | |||
| 54 | Returns the article id (not the name) that the link orginiates from. | ||
| 55 | |||
| 56 | =item $link->namespace | ||
| 57 | |||
| 58 | Returns the namespace id (not the name) that the link points to | ||
| 59 | |||
| 60 | =item $link->to | ||
| 61 | |||
| 62 | Returns the article title (not the id and not including the namespace) that the link points to | ||
| 63 |