Module: VkMusic::Utility::AudiosFromIdsLoader

Defined in:
lib/vk_music/utility/audios_from_ids_loader.rb

Overview

Load audios from ids

Class Method Summary collapse

Class Method Details

.call(agent, ids, client_id) ⇒ Array<Audio>

Parameters:

  • agent (Mechanize)
  • ids (Array<String>)

Returns:



10
11
12
13
14
15
16
17
18
# File 'lib/vk_music/utility/audios_from_ids_loader.rb', line 10

def self.call(agent, ids, client_id)
  audios = []
  ids.each_slice(10) do |subarray|
    page = Request::AudiosReload.new(subarray, client_id)
    page.call(agent)
    audios.concat(page.audios)
  end
  audios
end