class Torrenter::Tracker::HTTPTracker
Attributes
response[R]
Public Class Methods
new(url, params)
click to toggle source
# File lib/torrenter/tracker/http_tracker.rb, line 8 def initialize(url, params) @address = URI(url) @params = params end
Public Instance Methods
connect()
click to toggle source
# File lib/torrenter/tracker/http_tracker.rb, line 13 def connect @address.query = URI.encode_www_form(@params) begin @response = BEncode.load(Net::HTTP.get(@address)) rescue Exception => e false end return self end
connect_interval()
click to toggle source
# File lib/torrenter/tracker/http_tracker.rb, line 28 def connect_interval @response['min interval'] end
connected?()
click to toggle source
# File lib/torrenter/tracker/http_tracker.rb, line 36 def connected? @response end
peer_list()
click to toggle source
# File lib/torrenter/tracker/http_tracker.rb, line 24 def peer_list format_peers(peers) end
peers()
click to toggle source
# File lib/torrenter/tracker/http_tracker.rb, line 32 def peers @response['peers'] end