Class: RUTorrent::Torrent
- Inherits:
-
Object
- Object
- RUTorrent::Torrent
- Defined in:
- lib/rutorrent/torrent.rb
Instance Attribute Summary collapse
-
#availability ⇒ Object
readonly
Returns the value of attribute availability.
-
#download_speed ⇒ Object
readonly
Returns the value of attribute download_speed.
-
#downloaded ⇒ Object
readonly
Returns the value of attribute downloaded.
-
#eta ⇒ Object
readonly
Returns the value of attribute eta.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#peers_connected ⇒ Object
readonly
Returns the value of attribute peers_connected.
-
#peers_in_swarm ⇒ Object
readonly
Returns the value of attribute peers_in_swarm.
-
#progress ⇒ Object
readonly
Returns the value of attribute progress.
-
#ratio ⇒ Object
readonly
Returns the value of attribute ratio.
-
#remaining ⇒ Object
readonly
Returns the value of attribute remaining.
-
#seeds_connected ⇒ Object
readonly
Returns the value of attribute seeds_connected.
-
#seeds_in_swarm ⇒ Object
readonly
Returns the value of attribute seeds_in_swarm.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#torrent_queue_order ⇒ Object
readonly
Returns the value of attribute torrent_queue_order.
-
#upload_speed ⇒ Object
readonly
Returns the value of attribute upload_speed.
-
#uploaded ⇒ Object
readonly
Returns the value of attribute uploaded.
Instance Method Summary collapse
- #checked? ⇒ Boolean
- #checking? ⇒ Boolean
- #error? ⇒ Boolean
- #files ⇒ Object
- #forcestart ⇒ Object
-
#initialize(server, array) ⇒ Torrent
constructor
A new instance of Torrent.
- #inspect ⇒ Object
- #loaded? ⇒ Boolean
- #pause ⇒ Object
- #paused? ⇒ Boolean
- #properties ⇒ Object
- #queuebottom ⇒ Object
- #queued? ⇒ Boolean
- #queuedown ⇒ Object
- #queuetop ⇒ Object
- #queueup ⇒ Object
- #recheck ⇒ Object
- #remove ⇒ Object
- #removedata ⇒ Object
- #start ⇒ Object
- #start_after_check? ⇒ Boolean
- #started? ⇒ Boolean
- #stop ⇒ Object
- #unpause ⇒ Object
Constructor Details
#initialize(server, array) ⇒ Torrent
Returns a new instance of Torrent.
10 11 12 13 14 15 16 17 |
# File 'lib/rutorrent/torrent.rb', line 10 def initialize(server, array) @server = server @hash, @status, @name, @size, @progress, @downloaded, @uploaded, @ratio, @upload_speed, @download_speed, @eta, @label, @peers_connected, @peers_in_swarm, @seeds_connected, @seeds_in_swarm, @availability, @torrent_queue_order, @remaining = array end |
Instance Attribute Details
#availability ⇒ Object (readonly)
Returns the value of attribute availability.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def availability @availability end |
#download_speed ⇒ Object (readonly)
Returns the value of attribute download_speed.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def download_speed @download_speed end |
#downloaded ⇒ Object (readonly)
Returns the value of attribute downloaded.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def downloaded @downloaded end |
#eta ⇒ Object (readonly)
Returns the value of attribute eta.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def eta @eta end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def hash @hash end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def name @name end |
#peers_connected ⇒ Object (readonly)
Returns the value of attribute peers_connected.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def peers_connected @peers_connected end |
#peers_in_swarm ⇒ Object (readonly)
Returns the value of attribute peers_in_swarm.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def peers_in_swarm @peers_in_swarm end |
#progress ⇒ Object (readonly)
Returns the value of attribute progress.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def progress @progress end |
#ratio ⇒ Object (readonly)
Returns the value of attribute ratio.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def ratio @ratio end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def remaining @remaining end |
#seeds_connected ⇒ Object (readonly)
Returns the value of attribute seeds_connected.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def seeds_connected @seeds_connected end |
#seeds_in_swarm ⇒ Object (readonly)
Returns the value of attribute seeds_in_swarm.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def seeds_in_swarm @seeds_in_swarm end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
8 9 10 |
# File 'lib/rutorrent/torrent.rb', line 8 def server @server end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def size @size end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def status @status end |
#torrent_queue_order ⇒ Object (readonly)
Returns the value of attribute torrent_queue_order.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def torrent_queue_order @torrent_queue_order end |
#upload_speed ⇒ Object (readonly)
Returns the value of attribute upload_speed.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def upload_speed @upload_speed end |
#uploaded ⇒ Object (readonly)
Returns the value of attribute uploaded.
3 4 5 |
# File 'lib/rutorrent/torrent.rb', line 3 def uploaded @uploaded end |
Instance Method Details
#checked? ⇒ Boolean
57 |
# File 'lib/rutorrent/torrent.rb', line 57 def checked?; !@status[3].zero? end |
#checking? ⇒ Boolean
55 |
# File 'lib/rutorrent/torrent.rb', line 55 def checking?; !@status[1].zero? end |
#error? ⇒ Boolean
58 |
# File 'lib/rutorrent/torrent.rb', line 58 def error?; !@status[4].zero? end |
#files ⇒ Object
19 20 21 22 |
# File 'lib/rutorrent/torrent.rb', line 19 def files load_files unless @files @files end |
#forcestart ⇒ Object
45 |
# File 'lib/rutorrent/torrent.rb', line 45 def forcestart; perform 'forcestart' end |
#inspect ⇒ Object
63 64 65 |
# File 'lib/rutorrent/torrent.rb', line 63 def inspect '#<%s:0x%8x %s>' % [self.class, object_id * 2, @name] end |
#loaded? ⇒ Boolean
61 |
# File 'lib/rutorrent/torrent.rb', line 61 def loaded?; !@status[7].zero? end |
#pause ⇒ Object
43 |
# File 'lib/rutorrent/torrent.rb', line 43 def pause; perform 'pause' end |
#paused? ⇒ Boolean
59 |
# File 'lib/rutorrent/torrent.rb', line 59 def paused?; !@status[5].zero? end |
#properties ⇒ Object
36 37 38 39 |
# File 'lib/rutorrent/torrent.rb', line 36 def properties load_properties unless @properties @properties end |
#queuebottom ⇒ Object
49 |
# File 'lib/rutorrent/torrent.rb', line 49 def queuebottom; perform 'queuebottom' end |
#queued? ⇒ Boolean
60 |
# File 'lib/rutorrent/torrent.rb', line 60 def queued?; !@status[6].zero? end |
#queuedown ⇒ Object
50 |
# File 'lib/rutorrent/torrent.rb', line 50 def queuedown; perform 'queuedown' end |
#queuetop ⇒ Object
51 |
# File 'lib/rutorrent/torrent.rb', line 51 def queuetop; perform 'queuetop' end |
#queueup ⇒ Object
52 |
# File 'lib/rutorrent/torrent.rb', line 52 def queueup; perform 'queueup' end |
#recheck ⇒ Object
46 |
# File 'lib/rutorrent/torrent.rb', line 46 def recheck; perform 'recheck' end |
#remove ⇒ Object
47 |
# File 'lib/rutorrent/torrent.rb', line 47 def remove; perform 'remove' end |
#removedata ⇒ Object
48 |
# File 'lib/rutorrent/torrent.rb', line 48 def removedata; perform 'removedata' end |
#start ⇒ Object
41 |
# File 'lib/rutorrent/torrent.rb', line 41 def start; perform 'start' end |
#start_after_check? ⇒ Boolean
56 |
# File 'lib/rutorrent/torrent.rb', line 56 def start_after_check?; !@status[2].zero? end |
#started? ⇒ Boolean
54 |
# File 'lib/rutorrent/torrent.rb', line 54 def started?; !@status[0].zero? end |
#stop ⇒ Object
42 |
# File 'lib/rutorrent/torrent.rb', line 42 def stop; perform 'stop' end |
#unpause ⇒ Object
44 |
# File 'lib/rutorrent/torrent.rb', line 44 def unpause; perform 'unpause' end |