Class: MyBitcasa::Delete

Inherits:
Object
  • Object
show all
Includes:
ConnectionPool
Defined in:
lib/my_bitcasa/delete.rb

Instance Attribute Summary

Attributes included from ConnectionPool

#connection

Instance Method Summary collapse

Methods included from ConnectionPool

#multipart_connection

Constructor Details

#initialize(*paths) ⇒ Delete

Returns a new instance of Delete.



8
9
10
# File 'lib/my_bitcasa/delete.rb', line 8

def initialize(*paths)
  @paths = paths.flatten
end

Instance Method Details

#deleteObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/my_bitcasa/delete.rb', line 12

def delete
  res = connection.post do |req|
    req.url "/delete"
    req.body = {
      selection: JSON.generate({
        paths: @paths,
        albums: {},
        artists: [],
        photo_albums: [],
      }),
    }
  end
end