Sha256: 190c95ce5731966acf758059a49b3c7e80c4cb8d4b80d374c71f539a8a10748b

Contents?: true

Size: 236 Bytes

Versions: 13

Compression:

Stored size: 236 Bytes

Contents

class ApiConstraints
  def initialize(options)
    @version = options[:version]
    @default = options[:default]
  end

  def matches?(req)
    @default || req.headers['Accept'].include?("application/vnd.example.v#{@version}")
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
voluntary-0.7.1 lib/api_constraints.rb
voluntary-0.7.0 lib/api_constraints.rb
voluntary-0.6.0 lib/api_constraints.rb
voluntary-0.5.2 lib/api_constraints.rb
voluntary-0.5.1 lib/api_constraints.rb
voluntary-0.5.0 lib/api_constraints.rb
voluntary-0.4.0 lib/api_constraints.rb
voluntary-0.3.0 lib/api_constraints.rb
voluntary-0.2.4 lib/api_constraints.rb
voluntary-0.2.3 lib/api_constraints.rb
voluntary-0.2.2 lib/api_constraints.rb
voluntary-0.2.1 lib/api_constraints.rb
voluntary-0.2.0 lib/api_constraints.rb