Module: VkMusic::Utility::CookieReader

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

Overview

Reads preserved cookies from file and writes them into a cookie jar

Class Method Summary collapse

Class Method Details

.call(jar, path) ⇒ Object

Parameters:

  • jar (HTTP::CookieJar)
  • path (string)


10
11
12
13
# File 'lib/vk_music/utility/cookie_reader.rb', line 10

def call(jar, path)
  data = File.read(path)
  data.start_with?('{') ? load_cookie_jar_json(jar, data) : load_cookie_jar_mechanize(jar)
end