Sha256: cc85b4151e84153112dbfc520986aa6d162660019d6087d18b5b45519096b781
Contents?: true
Size: 1.18 KB
Versions: 3
Compression:
Stored size: 1.18 KB
Contents
require 'attune/param_flattener' require "attune/call_dropping" require "attune/json_logger" require "attune/gzip" require "attune/net_http_persistent" module Attune # Default options module Default extend Configurable ENDPOINT = "https://api.attune-staging.co".freeze # user our version of NetHttpPersistent adapter Faraday::Adapter.register_middleware(attune_http_persistent: NetHttpPersistent) MIDDLEWARE = Faraday::Builder.new do |builder| # Needed for encoding of BATCH GET requests builder.use Attune::ParamFlattener # Log all requests builder.use Attune::CallDropping builder.request :url_encoded # Allow one retry per request builder.request :retry, 1 # Log all requests builder.use Attune::JsonLogger # Gzip requests, Faraday handles responses automatically builder.use Attune::Gzip # Raise exceptions for HTTP 4xx/5xx builder.response :raise_error builder.adapter :attune_http_persistent end configure do |c| c.endpoint = ENDPOINT c.middleware = MIDDLEWARE c.disabled = false c.exception_handler = :raise c.timeout = 1 end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
attune-1.0.11 | lib/attune/default.rb |
attune-1.0.10 | lib/attune/default.rb |
attune-1.0.9 | lib/attune/default.rb |