Sha256: f2f275fe3f8dec7518ab4b3f5b129e2fc5010c41273ecd2e7df593895072ef41

Contents?: true

Size: 332 Bytes

Versions: 15

Compression:

Stored size: 332 Bytes

Contents

# frozen_string_literal: true

class APIConstraints
  def initialize(version:, default: false)
    @version = version
    @default = default
  end

  def matches?(req)
    @default || req.headers['Accept'].include?(version_string)
  end

  private

  def version_string
    "application/vnd.aaf.example.v#{@version}+json"
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
aaf-gumboot-2.6.3 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.6.2 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.6.1 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.6.0 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.5.1 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.5.0 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.4.0 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.2.0 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.1.4 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.1.3 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.1.1 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.1.0 spec/dummy/lib/api_constraints.rb
aaf-gumboot-2.0.1 spec/dummy/lib/api_constraints.rb
aaf-gumboot-1.2.0 spec/dummy/lib/api_constraints.rb
aaf-gumboot-1.1.0 spec/dummy/lib/api_constraints.rb