Class: QuartzTorrent::ManagePeersResult

Inherits:
Object
  • Object
show all
Defined in:
lib/quartz_torrent/peermanager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeManagePeersResult

Returns a new instance of ManagePeersResult.



5
6
7
8
# File 'lib/quartz_torrent/peermanager.rb', line 5

def initialize
  @unchoke = []
  @choke = []
end

Instance Attribute Details

#chokeObject

List of peers to choke



13
14
15
# File 'lib/quartz_torrent/peermanager.rb', line 13

def choke
  @choke
end

#unchokeObject

List of peers to unchoke



11
12
13
# File 'lib/quartz_torrent/peermanager.rb', line 11

def unchoke
  @unchoke
end

Instance Method Details

#to_sObject



15
16
17
18
19
20
21
22
# File 'lib/quartz_torrent/peermanager.rb', line 15

def to_s
  s = "Peers to unchoke: "
  s << unchoke.collect{ |p| p.nil? ? "'nil'" : "'#{p}'" }.join(" ")
  s << "\n"
  s << "Peers to choke: "
  s << choke.collect{ |p| p.nil? ? "'nil'" : "'#{p}'" }.join(" ")
  s << "\n"
end