Sha256: a78efc6c8b50dfe1aeb42a2dfc58fa58617dcf9fd96b518ecf3dff0dcb6ffdc1
Contents?: true
Size: 432 Bytes
Versions: 5
Compression:
Stored size: 432 Bytes
Contents
class ApiConstraints def initialize(options) @version = options[:version] @default = options.has_key?(:default) ? options[:default] : false end def matches?(req) req.accept =~ /version=([\d\.]+)/ if (version = $1) # version is specified in header version == @version.to_s # are the versions same else @default # version is not specified, match if it's default version of api end end end
Version data entries
5 entries across 5 versions & 1 rubygems