| 1 | #$Id: DItem.pm 355 2008-10-05 11:20:30Z zag $ | ||
| 2 | |||
| 3 | package Net::RTorrent::DItem; | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Net::RTorrent::DItem - Class of rtorrent item. | ||
| 8 | |||
| 9 | =head1 SYNOPSIS | ||
| 10 | |||
| 11 | my $obj = new Net::RTorrent:: 'http://10.100.0.1:8080/scgitest'; | ||
| 12 | my $dloads = $obj->get_downloads('complete'); | ||
| 13 | my $keys = $dloads->list_ids; | ||
| 14 | my $ditem = $dloads->get_one( $key); | ||
| 15 | if ( $ditem->attr->{left_bytes} ) { | ||
| 16 | $ditem->stop | ||
| 17 | } | ||
| 18 | |||
| 19 | |||
| 20 | =head1 ABSTRACT | ||
| 21 | |||
| 22 | Net::RTorrent::DItem - Class of rtorrent item. | ||
| 23 | |||
| 24 | =head1 DESCRIPTION | ||
| 25 | |||
| 26 | Net::RTorrent::DItem - Class of rtorrent item. | ||
| 27 | |||
| 28 | =cut | ||
| 29 | |||
| 30 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 31 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 32 | 2 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 33 | 2 | ▶ | use Data::Dumper; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | 2 | ▶ | use Collection::Utl::Base; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | 2 | ▶ | use Collection::Utl::Item; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 36 | 2 | ▶ | use 5.005; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 37 | 2 | __PACKAGE__->attributes(qw / _cli/); | |
| 38 | 2 | our @ISA = qw(Collection::Utl::Item); | |
| 39 | 2 | our $VERSION = '0.01'; | |
| 40 | 0 | ▶ | sub _changed { return 0 } |
|
Subroutine
_changed: not called CC=1 SCAR=6.9
| |||
| 41 | |||
| 42 | =head1 METHODS | ||
| 43 | |||
| 44 | =cut | ||
| 45 | |||
| 46 | =head2 attr | ||
| 47 | |||
| 48 | Attributes for torrent. | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | 0 | ▶ | sub attr { |
|
Subroutine
attr: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 53 | 0 | return $_[0]->_attr; | |
| 54 | } | ||
| 55 | |||
| 56 | 0 | ▶ | sub init { |
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 57 | 0 | my $self = shift; | |
| 58 | 0 | $self->_cli(shift); | |
| 59 | 0 | return $self->SUPER::init(@_); | |
| 60 | } | ||
| 61 | |||
| 62 | =head2 stop | ||
| 63 | |||
| 64 | Stop torrent | ||
| 65 | |||
| 66 | =cut | ||
| 67 | |||
| 68 | 0 | ▶ | sub stop { |
|
Subroutine
stop: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 69 | 0 | my $self = shift; | |
| 70 | 0 | $self->_cli->send_request(); | |
| 71 | } | ||
| 72 | |||
| 73 | 2 | 1; | |
| 74 | __END__ | ||