10 lines
237 B
Ruby
10 lines
237 B
Ruby
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
|