Module: SinatraSimpleRouter::ClassMethods
- Defined in:
- lib/sinatra_simple_router.rb
Instance Method Summary collapse
Instance Method Details
#match(method, path, klass, action) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sinatra_simple_router.rb', line 14 def match(method, path, klass, action) if @version path = "/#{@version}#{path}" end puts "Registering: #{path}" send(method, path) do klass.new(self).send(action) end end |
#version(version, &block) ⇒ Object
25 26 27 28 29 |
# File 'lib/sinatra_simple_router.rb', line 25 def version(version, &block) @version = version instance_eval(&block) @version = nil end |