Class: Biceps::ApiVersion
- Inherits:
-
Object
- Object
- Biceps::ApiVersion
- Defined in:
- lib/biceps/api_version.rb
Instance Attribute Summary collapse
-
#accept ⇒ Object
Returns the value of attribute accept.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(version) ⇒ ApiVersion
constructor
A new instance of ApiVersion.
- #matches?(request) ⇒ Boolean
Constructor Details
#initialize(version) ⇒ ApiVersion
Returns a new instance of ApiVersion.
5 6 7 8 |
# File 'lib/biceps/api_version.rb', line 5 def initialize(version) @version = [version].flatten @version_matcher = {} end |
Instance Attribute Details
#accept ⇒ Object
Returns the value of attribute accept.
3 4 5 |
# File 'lib/biceps/api_version.rb', line 3 def accept @accept end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/biceps/api_version.rb', line 3 def version @version end |
Instance Method Details
#matches?(request) ⇒ Boolean
10 11 12 13 |
# File 'lib/biceps/api_version.rb', line 10 def matches?(request) @accept = request.accept valid_api_version? end |