Module: Sinatra::Controllers
- Defined in:
- lib/sinatra-controllers.rb,
lib/sinatra-controllers/version.rb
Defined Under Namespace
Classes: Mapping
Constant Summary collapse
- VERSION =
"0.2.3"
Class Method Summary collapse
Class Method Details
.register(klass, opts = {}, &block) ⇒ Object
66 67 68 69 70 |
# File 'lib/sinatra-controllers.rb', line 66 def register(klass, opts={}, &block) map = Mapping.new(klass,opts) map.instance_eval(&block) if block map.parse end |
.routes ⇒ Object
71 72 73 |
# File 'lib/sinatra-controllers.rb', line 71 def routes Sinatra::Controllers::Mapping.routes end |
.show_routes ⇒ Object
74 75 76 77 78 79 80 |
# File 'lib/sinatra-controllers.rb', line 74 def show_routes routes.each do |verb, path, action| puts puts "#{verb.to_s.ljust(8)}#{path.ljust(35)}#{action.ljust(25)}" puts end end |