Sha256: 411e7b4b351991dd3debf0b9039e15af994581d0e0173972de6a080c86536c2a

Contents?: true

Size: 296 Bytes

Versions: 7

Compression:

Stored size: 296 Bytes

Contents

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

    def matches?(req)
      @default || req.headers['Accept'].include?("application/vnd.menglifang.com.cn; version=#{@version}")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
task-manager-0.1.7 lib/task-manager/api_constraints.rb
task-manager-0.1.6 lib/task-manager/api_constraints.rb
task-manager-0.1.5 lib/task-manager/api_constraints.rb
task-manager-0.1.4 lib/task-manager/api_constraints.rb
task-manager-0.1.3 lib/task-manager/api_constraints.rb
task-manager-0.1.2 lib/task-manager/api_constraints.rb
task-manager-0.1.1 lib/task-manager/api_constraints.rb