Class: Pliny::Router
- Inherits:
-
Sinatra::Router
- Object
- Sinatra::Router
- Pliny::Router
- Defined in:
- lib/pliny/router.rb
Instance Method Summary collapse
-
#version(*versions, &block) ⇒ Object
yield to a builder block in which all defined apps will only respond for the given version.
Instance Method Details
#version(*versions, &block) ⇒ Object
yield to a builder block in which all defined apps will only respond for the given version
8 9 10 11 12 13 |
# File 'lib/pliny/router.rb', line 8 def version(*versions, &block) condition = lambda { |env| versions.include?(env["HTTP_X_API_VERSION"]) } with_conditions(condition, &block) end |