module Crystal class DefaultRouter inject :logger => :logger def encode klass, method, params path = "/#{klass.name.underscore}/#{method}" return path, params end def decode path, params parts = path[1..-1].split '/' if parts.size >= 2 method = parts.pop class_path = parts.join('/') class_name = class_path.camelize klass = class_name.constantize return klass, method, params end end end end