Class: Putio::Transfer

Inherits:
Api::Object show all
Defined in:
lib/putio-ruby/transfer.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Api::Object

#client

Methods included from Api::Client

#client

Class Method Details

.add(url) ⇒ Object



40
41
42
# File 'lib/putio-ruby/transfer.rb', line 40

def self.add(url)
  self.new client.post("transfers/add", :url => url).body
end

.listObject



31
32
33
34
# File 'lib/putio-ruby/transfer.rb', line 31

def self.list
  res = client.get("transfers/list")
  res.body.map { |t| self.new t }
end

.transfer(id) ⇒ Object



36
37
38
# File 'lib/putio-ruby/transfer.rb', line 36

def self.transfer(id)
  self.new client.get("transfers/#{id}").body
end

Instance Method Details

#fetchObject



44
45
46
# File 'lib/putio-ruby/transfer.rb', line 44

def fetch
  self.class.transfer(id)
end