lib/hanami/router.rb in hanami-router-0.7.0 vs lib/hanami/router.rb in hanami-router-0.8.0

- old
+ new

@@ -497,10 +497,48 @@ # @since 0.1.0 def trace(path, options = {}, &blk) @router.trace(path, options, &blk) end + # Defines a route that accepts a LINK request for the given path. + # + # @param path [String] the relative URL to be matched + # + # @param options [Hash] the options to customize the route + # @option options [String,Proc,Class,Object#call] :to the endpoint + # + # @param blk [Proc] the anonymous proc to be used as endpoint for the route + # + # @return [Hanami::Routing::Route] this may vary according to the :route + # option passed to the constructor + # + # @see Hanami::Router#get + # + # @since 0.8.0 + def link(path, options = {}, &blk) + @router.link(path, options, &blk) + end + + # Defines a route that accepts an UNLINK request for the given path. + # + # @param path [String] the relative URL to be matched + # + # @param options [Hash] the options to customize the route + # @option options [String,Proc,Class,Object#call] :to the endpoint + # + # @param blk [Proc] the anonymous proc to be used as endpoint for the route + # + # @return [Hanami::Routing::Route] this may vary according to the :route + # option passed to the constructor + # + # @see Hanami::Router#get + # + # @since 0.8.0 + def unlink(path, options = {}, &blk) + @router.unlink(path, options, &blk) + end + # Defines a root route (a GET route for '/') # # @param options [Hash] the options to customize the route # @option options [String,Proc,Class,Object#call] :to the endpoint # @@ -1163,10 +1201,10 @@ # login GET, HEAD /login Sessions::New # POST /login Sessions::Create # logout GET, HEAD /logout Sessions::Destroy def inspector require 'hanami/routing/routes_inspector' - Routing::RoutesInspector.new(@router.routes) + Routing::RoutesInspector.new(@router.routes, @router.prefix) end protected # Fabricate Rack env for the given Rack env, path or named route