diff --git a/lib/api_version.rb b/lib/api_version.rb new file mode 100644 index 0000000..2d15488 --- /dev/null +++ b/lib/api_version.rb @@ -0,0 +1,10 @@ +class ApiVersion + def initialize(options={}) + @version = options[:version] + @default = options[:default] + end + + def matches?(req) + @default || req.headers['Accept'].include?("application/archiving.v#{@version}") + end +end