Module: Yandex::Market::Connection

Included in:
Client
Defined in:
lib/yandex/market/content/connection.rb

Instance Method Summary collapse

Instance Method Details

#callObject



8
9
10
11
12
13
# File 'lib/yandex/market/content/connection.rb', line 8

def call
  connection(
    url: Content.configuration.resource_url,
    version: Content.configuration.version
  )
end

#connection(url:, version:) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/yandex/market/content/connection.rb', line 15

def connection(url:, version:)
  url = [url, version].join('/')
  Faraday.new(url) do |builder|
    builder.request  :url_encoded
    builder.response :logger
    builder.adapter  Faraday.default_adapter
  end
end

#get(url, options = {}) ⇒ Object



4
5
6
# File 'lib/yandex/market/content/connection.rb', line 4

def get(url, options = {})
  request :get, url, options
end