Class: QuartzTorrent::ManagePeersResult
- Inherits:
-
Object
- Object
- QuartzTorrent::ManagePeersResult
- Defined in:
- lib/quartz_torrent/peermanager.rb
Instance Attribute Summary collapse
-
#choke ⇒ Object
List of peers to choke.
-
#unchoke ⇒ Object
List of peers to unchoke.
Instance Method Summary collapse
-
#initialize ⇒ ManagePeersResult
constructor
A new instance of ManagePeersResult.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ ManagePeersResult
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
#choke ⇒ Object
List of peers to choke
13 14 15 |
# File 'lib/quartz_torrent/peermanager.rb', line 13 def choke @choke end |
#unchoke ⇒ Object
List of peers to unchoke
11 12 13 |
# File 'lib/quartz_torrent/peermanager.rb', line 11 def unchoke @unchoke end |
Instance Method Details
#to_s ⇒ Object
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 |