Class: RUTorrent::Torrent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#availabilityObject (readonly)

Returns the value of attribute availability



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

def availability
  @availability
end

#download_speedObject (readonly)

Returns the value of attribute download_speed



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

def download_speed
  @download_speed
end

#downloadedObject (readonly)

Returns the value of attribute downloaded



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

def downloaded
  @downloaded
end

#etaObject (readonly)

Returns the value of attribute eta



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

def eta
  @eta
end

#hashObject (readonly)

Returns the value of attribute hash



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

def hash
  @hash
end

#labelObject (readonly)

Returns the value of attribute label



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

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name



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

def name
  @name
end

#peers_connectedObject (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_swarmObject (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

#progressObject (readonly)

Returns the value of attribute progress



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

def progress
  @progress
end

#ratioObject (readonly)

Returns the value of attribute ratio



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

def ratio
  @ratio
end

#remainingObject (readonly)

Returns the value of attribute remaining



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

def remaining
  @remaining
end

#seeds_connectedObject (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_swarmObject (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

#serverObject (readonly)

Returns the value of attribute server



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

def server
  @server
end

#sizeObject (readonly)

Returns the value of attribute size



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

def size
  @size
end

#statusObject (readonly)

Returns the value of attribute status



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

def status
  @status
end

#torrent_queue_orderObject (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_speedObject (readonly)

Returns the value of attribute upload_speed



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

def upload_speed
  @upload_speed
end

#uploadedObject (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

Returns:

  • (Boolean)


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

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

#checking?Boolean

Returns:

  • (Boolean)


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

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

#error?Boolean

Returns:

  • (Boolean)


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

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

#filesObject



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

def files
  load_files unless @files
  @files
end

#forcestartObject



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

def forcestart;  perform 'forcestart'  end

#inspectObject



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

Returns:

  • (Boolean)


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

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

#pauseObject



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

def pause;       perform 'pause'       end

#paused?Boolean

Returns:

  • (Boolean)


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

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

#propertiesObject



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

def properties
  load_properties unless @properties
  @properties
end

#queuebottomObject



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

def queuebottom; perform 'queuebottom' end

#queued?Boolean

Returns:

  • (Boolean)


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

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

#queuedownObject



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

def queuedown;   perform 'queuedown'   end

#queuetopObject



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

def queuetop;    perform 'queuetop'    end

#queueupObject



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

def queueup;     perform 'queueup'     end

#recheckObject



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

def recheck;     perform 'recheck'     end

#removeObject



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

def remove;      perform 'remove'      end

#removedataObject



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

def removedata;  perform 'removedata'  end

#startObject



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

def start;       perform 'start'       end

#start_after_check?Boolean

Returns:

  • (Boolean)


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

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

#started?Boolean

Returns:

  • (Boolean)


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

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

#stopObject



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

def stop;        perform 'stop'        end

#unpauseObject



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

def unpause;     perform 'unpause'     end