Class: VkMusic::Request::Search

Inherits:
Base
  • Object
show all
Defined in:
lib/vk_music/request/search.rb

Overview

Logging in request

Instance Attribute Summary

Attributes inherited from Base

#data, #headers, #method, #path, #response

Instance Method Summary collapse

Methods inherited from Base

#call

Constructor Details

#initialize(query, client_id) ⇒ Search

Initialize new request

Parameters:

  • query (String)
  • client_id (Integer)


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

def initialize(query, client_id)
  @client_id = client_id
  super(
    "#{VK_ROOT}/audio",
    { q: query, _ajax: 1 },
    'POST',
    { 'content-type' => 'application/x-www-form-urlencoded', 'x-requested-with' => 'XMLHttpRequest' }
  )
end