Module: Pixmatch::Client::Add
- Included in:
- Pixmatch::Client
- Defined in:
- lib/pixmatch/client/add.rb
Instance Method Summary collapse
-
#add(files) ⇒ Object
Index and Add a list of images to your collection.
Instance Method Details
#add(files) ⇒ Object
Index and Add a list of images to your collection.
6 7 8 9 10 11 |
# File 'lib/pixmatch/client/add.rb', line 6 def add(files) files = [ files ] if (files.is_a?(String) || files.is_a?(File)) files_hash = { } files.each { |f| files_hash["images[#{files_hash.size}]"] = f.is_a?(File) ? f : File.new(f, "rb") } request(:post, 'rest', { method: :add }, { payload: files_hash }) end |