Module: VkMusic::Utility::AudiosIdsGetter

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

Overview

Load ids from array of data

Class Method Summary collapse

Class Method Details

.call(args) ⇒ Array<String>

Returns array of uniq full ids.

Parameters:

  • args (Array<Audio, (owner_id, audio_id, secret_1, secret_2), "#{owner_id}_#{id}_#{secret_1}_#{secret_2}">)

Returns:

  • (Array<String>)

    array of uniq full ids



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/vk_music/utility/audios_ids_getter.rb', line 10

def self.call(args)
  ids = args.map do |item|
    case item
    when Audio then item.full_id
    when Array then item.join('_')
    when String then item
    end
  end
  ids.compact!
  ids.uniq!

  ids
end