lib/vkontakte_api/uploading.rb in vkontakte_api-1.3.1 vs lib/vkontakte_api/uploading.rb in vkontakte_api-1.4
- old
+ new
@@ -1,8 +1,8 @@
module VkontakteApi
# A module implementing files uploading functionality.
- #
+ #
# @note `VkontakteApi::Uploading` extends `VkontakteApi` so these methods should be called from the latter.
module Uploading
# Files uploading. It uses the same faraday middleware stack as API method calls (by using `VkontakteApi::API.connection`).
# @param [Hash] params A list of files to upload (also includes the upload URL). See example for the hash format.
# @option params [String] :url URL for the request.
@@ -20,10 +20,9 @@
# files: [
# ['/path/to/file1.jpg', 'image/jpeg'],
# [io_object, 'image/png', '/path/to/file2.png']
# ]
# )
-
def upload(params = {})
url = params.delete(:url)
raise ArgumentError, 'You should pass :url parameter' unless url
(params.delete(:files) || []).each_with_index do |file, index|