Class: RUTorrent::Torrent

Inherits:
Object
  • Object
show all
Defined in:
lib/rutorrent/torrent.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Torrent) initialize(server, array)



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

- (Object) availability (readonly)

Returns the value of attribute availability



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def availability
  @availability
end

- (Object) download_speed (readonly)

Returns the value of attribute download_speed



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def download_speed
  @download_speed
end

- (Object) downloaded (readonly)

Returns the value of attribute downloaded



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def downloaded
  @downloaded
end

- (Object) eta (readonly)

Returns the value of attribute eta



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def eta
  @eta
end

- (Object) hash (readonly)

Returns the value of attribute hash



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def hash
  @hash
end

- (Object) label (readonly)

Returns the value of attribute label



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def label
  @label
end

- (Object) name (readonly)

Returns the value of attribute name



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def name
  @name
end

- (Object) peers_connected (readonly)

Returns the value of attribute peers_connected



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def peers_connected
  @peers_connected
end

- (Object) peers_in_swarm (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

- (Object) progress (readonly)

Returns the value of attribute progress



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def progress
  @progress
end

- (Object) ratio (readonly)

Returns the value of attribute ratio



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def ratio
  @ratio
end

- (Object) remaining (readonly)

Returns the value of attribute remaining



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def remaining
  @remaining
end

- (Object) seeds_connected (readonly)

Returns the value of attribute seeds_connected



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def seeds_connected
  @seeds_connected
end

- (Object) seeds_in_swarm (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

- (Object) server (readonly)

Returns the value of attribute server



8
9
10
# File 'lib/rutorrent/torrent.rb', line 8

def server
  @server
end

- (Object) size (readonly)

Returns the value of attribute size



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def size
  @size
end

- (Object) status (readonly)

Returns the value of attribute status



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def status
  @status
end

- (Object) torrent_queue_order (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

- (Object) upload_speed (readonly)

Returns the value of attribute upload_speed



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def upload_speed
  @upload_speed
end

- (Object) uploaded (readonly)

Returns the value of attribute uploaded



3
4
5
# File 'lib/rutorrent/torrent.rb', line 3

def uploaded
  @uploaded
end

Instance Method Details

- (Boolean) checked?



57
# File 'lib/rutorrent/torrent.rb', line 57

def checked?;           !@status[3].zero? end

- (Boolean) checking?



55
# File 'lib/rutorrent/torrent.rb', line 55

def checking?;          !@status[1].zero? end

- (Boolean) error?



58
# File 'lib/rutorrent/torrent.rb', line 58

def error?;             !@status[4].zero? end

- (Object) files



19
20
21
22
# File 'lib/rutorrent/torrent.rb', line 19

def files
  load_files unless @files
  @files
end

- (Object) forcestart



45
# File 'lib/rutorrent/torrent.rb', line 45

def forcestart;  perform 'forcestart'  end

- (Object) inspect



63
64
65
# File 'lib/rutorrent/torrent.rb', line 63

def inspect
  '#<%s:0x%8x %s>' % [self.class, object_id * 2, @name]
end

- (Boolean) loaded?



61
# File 'lib/rutorrent/torrent.rb', line 61

def loaded?;            !@status[7].zero? end

- (Object) pause



43
# File 'lib/rutorrent/torrent.rb', line 43

def pause;       perform 'pause'       end

- (Boolean) paused?



59
# File 'lib/rutorrent/torrent.rb', line 59

def paused?;            !@status[5].zero? end

- (Object) properties



36
37
38
39
# File 'lib/rutorrent/torrent.rb', line 36

def properties
  load_properties unless @properties
  @properties
end

- (Object) queuebottom



49
# File 'lib/rutorrent/torrent.rb', line 49

def queuebottom; perform 'queuebottom' end

- (Boolean) queued?



60
# File 'lib/rutorrent/torrent.rb', line 60

def queued?;            !@status[6].zero? end

- (Object) queuedown



50
# File 'lib/rutorrent/torrent.rb', line 50

def queuedown;   perform 'queuedown'   end

- (Object) queuetop



51
# File 'lib/rutorrent/torrent.rb', line 51

def queuetop;    perform 'queuetop'    end

- (Object) queueup



52
# File 'lib/rutorrent/torrent.rb', line 52

def queueup;     perform 'queueup'     end

- (Object) recheck



46
# File 'lib/rutorrent/torrent.rb', line 46

def recheck;     perform 'recheck'     end

- (Object) remove



47
# File 'lib/rutorrent/torrent.rb', line 47

def remove;      perform 'remove'      end

- (Object) removedata



48
# File 'lib/rutorrent/torrent.rb', line 48

def removedata;  perform 'removedata'  end

- (Object) start



41
# File 'lib/rutorrent/torrent.rb', line 41

def start;       perform 'start'       end

- (Boolean) start_after_check?



56
# File 'lib/rutorrent/torrent.rb', line 56

def start_after_check?; !@status[2].zero? end

- (Boolean) started?



54
# File 'lib/rutorrent/torrent.rb', line 54

def started?;           !@status[0].zero? end

- (Object) stop



42
# File 'lib/rutorrent/torrent.rb', line 42

def stop;        perform 'stop'        end

- (Object) unpause



44
# File 'lib/rutorrent/torrent.rb', line 44

def unpause;     perform 'unpause'     end