Module: Pixmatch::Client::Delete

Included in:
Pixmatch::Client
Defined in:
lib/pixmatch/client/delete.rb

Instance Method Summary collapse

Instance Method Details

#delete(filenames) ⇒ Object

Given a list of image filenames, delete the images from the collection.

Parameters:

  • files (Array)

    Array of file names.



6
7
8
9
10
11
# File 'lib/pixmatch/client/delete.rb', line 6

def delete(filenames) 
  filenames = [ filenames ] if filenames.is_a?(String)
  filenames_hash = { }
  filenames.each { |f| filenames_hash["filenames[#{filenames_hash.size}]"] = f }
  request(:post, 'rest', { method: :delete }, { payload: filenames_hash })
end