module Deploygate::Client::API

Default faraday settings

Constants

BASE_URL

Private Instance Methods

api() click to toggle source
# File lib/deploygate/client/api.rb, line 14
def api
  @api ||= Faraday.new(url: BASE_URL) do |builder|
    builder.options.open_timeout = open_timeout
    builder.options.timeout = timeout

    builder.request :multipart

    if symbolize_response
      builder.response :json, parser_options: { symbolize_names: true }
    end

    builder.headers['Authorization'] = "token #{token}"
    builder.adapter Faraday.default_adapter
  end
end