Module: ChgkRating::Connection

Included in:
Request
Defined in:
lib/chgk_rating/connection.rb

Constant Summary collapse

BASE_URL =
'http://rating.chgk.info/api'.freeze

Instance Method Summary collapse

Instance Method Details

#connectionObject


5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/chgk_rating/connection.rb', line 5

def connection
  options = {
      headers: {
          accept: 'application/json',
          user_agent: "chgk_rating ruby gem/#{ChgkRating::VERSION}"
      },
      url: BASE_URL + '/'
  }

  Faraday.new options do |faraday|
    faraday.adapter Faraday.default_adapter
  end
end