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, instantiate_object, parse_collection, parse_object, plural_name, #set_attribute, singular_name

Methods included from Api::Client

#client

Class Method Details

.add(url) ⇒ Object



13
14
15
16
# File 'lib/putio-ruby/transfer.rb', line 13

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

.get(id) ⇒ Object



8
9
10
11
# File 'lib/putio-ruby/transfer.rb', line 8

def self.get(id)
  res = client.get "transfers/#{id}"
  parse_object res.body if res.success?
end

.listObject



3
4
5
6
# File 'lib/putio-ruby/transfer.rb', line 3

def self.list
  res = client.get "transfers/list"
  parse_collection res.body if res.success?
end

Instance Method Details

#fetchObject



18
19
20
# File 'lib/putio-ruby/transfer.rb', line 18

def fetch
  self.class.find(id)
end