Class: Apill::Matchers::VersionMatcher
- Inherits:
-
Object
- Object
- Apill::Matchers::VersionMatcher
- Includes:
- GenericMatcher
- Defined in:
- lib/apill/matchers/version_matcher.rb
Instance Attribute Summary collapse
-
#default_version ⇒ Object
Returns the value of attribute default_version.
-
#version_constraint ⇒ Object
Returns the value of attribute version_constraint.
Attributes included from GenericMatcher
Instance Method Summary collapse
Methods included from GenericMatcher
Instance Attribute Details
#default_version ⇒ Object
Returns the value of attribute default_version.
9 10 11 |
# File 'lib/apill/matchers/version_matcher.rb', line 9 def default_version @default_version end |
#version_constraint ⇒ Object
Returns the value of attribute version_constraint.
9 10 11 |
# File 'lib/apill/matchers/version_matcher.rb', line 9 def version_constraint @version_constraint end |
Instance Method Details
#matches?(request) ⇒ Boolean
12 13 14 15 16 17 18 19 |
# File 'lib/apill/matchers/version_matcher.rb', line 12 def matches?(request) super raise Apill::Errors::InvalidApiRequestError unless accept_header.valid? request.subdomains.first == 'api' && requested_version == version_constraint end |