Module: Roda::RodaPlugins::StaticRouting::InstanceMethods

Defined in:
lib/roda/plugins/static_routing.rb

Instance Method Summary collapse

Instance Method Details

#call(&block) ⇒ Object

If there is a static routing method for the given path, call it instead having the routing tree handle the request.



109
110
111
112
113
114
115
116
117
# File 'lib/roda/plugins/static_routing.rb', line 109

def call(&block)
  super do |r|
    if route = self.class.static_route_for(r.request_method, r.path_info)
      r.static_route(&route)
    else
      instance_exec(r, &block)
    end
  end
end