Sha256: 7919ad39e8dd20e42e1f45707658b2570b46118bfb0708cbb98db8995d2735a6
Contents?: true
Size: 682 Bytes
Versions: 3
Compression:
Stored size: 682 Bytes
Contents
# -*- encoding : utf-8 -*- module Ashikawa module Core # Sets the ArangoDB API compatibility header class XArangoVersion < Faraday::Middleware # The name of the x-arango-version header field HEADER = 'X-Arango-Version'.freeze # Initializes the middleware # # @param [Callable] app The faraday app def initialize(app) super(app) end # Sets the `x-arango-version` for each request def call(env) env[:request_headers][HEADER] = Ashikawa::Core.api_compatibility_version @app.call(env) end end Faraday::Request.register_middleware x_arango_version: -> { XArangoVersion } end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ashikawa-core-0.14.0 | lib/ashikawa-core/x_arango_version.rb |
ashikawa-core-0.13.1 | lib/ashikawa-core/x_arango_version.rb |
ashikawa-core-0.13.0 | lib/ashikawa-core/x_arango_version.rb |