lotus/router — pull request #27 by jodosha (2014-11-06 14:25:15+00:00)
Title: Introducing routes inspector

```ruby
require 'lotus/router'

class RackMiddleware
def self.call(env)
end
end

class RackMiddlewareInstanceMethod
def call(env)
end
end

module DashboardController
class Index
end
end

router = Lotus::Router.new do
get '/login', to: ->(env) { }, as: :login
get '/logout', to: Proc.new {|env| }, as: :logout
get '/controller/action', to: 'dashboard#index'
get '/lazy', to: 'lazy#index'
get '/missing', to: 'missing#index'
get '/class', to: RackMiddleware
get '/class_with_#call', to: RackMiddlewareInstanceMethod
get '/object', to: RackMiddlewareInstanceMethod.new

resource :identity
resources :books
end

module LazyController
class Index
end
end

puts router.inspector # =>
# login GET, HEAD /login #
# logout GET, HEAD /logout #
# GET, HEAD /controller/action DashboardController::Index
# GET, HEAD /lazy LazyController::Index
# GET, HEAD /missing Missing(::Controller::|Controller::)Index
# GET, HEAD /class RackMiddleware
# GET, HEAD /class_with_#call #
# GET, HEAD /object #
# new_identity GET, HEAD /identity/new Identity(::Controller::|Controller::)New
# identity POST /identity Identity(::Controller::|Controller::)Create
# identity GET, HEAD /identity Identity(::Controller::|Controller::)Show
# edit_identity GET, HEAD /identity/edit Identity(::Controller::|Controller::)Edit
# identity PATCH /identity Identity(::Controller::|Controller::)Update
# identity DELETE /identity Identity(::Controller::|Controller::)Destroy
# books GET, HEAD /books Books(::Controller::|Controller::)Index
# new_books GET, HEAD /books/new Books(::Controller::|Controller::)New
# books POST /books Books(::Controller::|Controller::)Create
# books GET, HEAD /books/:id Books(::Controller::|Controller::)Show
# edit_books GET, HEAD /books/:id/edit Books(::Controller::|Controller::)Edit
# books PATCH /books/:id Books(::Controller::|Controller::)Update
# books DELETE /books/:id Books(::Controller::|Controller::)Destroy
```

Closes #16