Class: Client

Inherits:
XMLRPC::Client
  • Object
show all
Defined in:
lib/client.rb

Instance Method Summary collapse

Instance Method Details

#erase(hash) ⇒ Object



21
22
23
# File 'lib/client.rb', line 21

def erase(hash)
  call('d.erase', hash)
end

#fetchObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/client.rb', line 2

def fetch
  d_objects = call_async('d.multicall', 'main', *render_downloads_queries).map do |t|
    Hash[QUERIES[:downloads].keys.zip(t)]
  end

  t_commands = render_trackers_commands(d_objects.map { |d| d[:hash] })
  t_objects  = multicall_async(*t_commands).map do |r|
    Hash[QUERIES[:trackers].keys.zip(r.first)]
  end

  d_objects.zip(t_objects).map do |d, t|
    Torrent.new(d.merge(t))
  end
end

#load_start(bytes) ⇒ Object



17
18
19
# File 'lib/client.rb', line 17

def load_start(bytes)
  call('load.raw_start', '', bytes)
end