Sha256: db489ff2b33c3c35d23eb721372303199fe626394c78691e57337a56ca80f80e

Contents?: true

Size: 1002 Bytes

Versions: 12

Compression:

Stored size: 1002 Bytes

Contents

= New Feature

* A match_hook_args plugin has been added.  This is similar to the
  existing match_hook plugin, but passes through the matchers and
  block arguments (values yielded to the match block). Example:

    plugin :match_hook_args
 
    add_match_hook do |matchers, block_args|
      logger.debug("matchers: #{matchers.inspect}. #{block_args.inspect} yielded.")
    end

    # Term is an implicit matcher used for terminating matches, and
    # will be included in the array of matchers yielded to the match hook
    # if a terminating match is used.
    term = self.class::RodaRequest::TERM

    route do |r|
      r.root do
        # for a request for /
        # matchers: nil, block_args: nil
      end

      r.on 'a', ['b', 'c'], Integer do |segment, id|
        # for a request for /a/b/1
        # matchers: ["a", ["b", "c"], Integer], block_args: ["b", 1]
      end

      r.get 'd' do
        # for a request for /d
        # matchers: ["d", term], block_args: []
      end
    end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
roda-3.83.0 doc/release_notes/3.71.0.txt
roda-3.82.0 doc/release_notes/3.71.0.txt
roda-3.81.0 doc/release_notes/3.71.0.txt
roda-3.79.0 doc/release_notes/3.71.0.txt
roda-3.78.0 doc/release_notes/3.71.0.txt
roda-3.77.0 doc/release_notes/3.71.0.txt
roda-3.76.0 doc/release_notes/3.71.0.txt
roda-3.75.0 doc/release_notes/3.71.0.txt
roda-3.74.0 doc/release_notes/3.71.0.txt
roda-3.73.0 doc/release_notes/3.71.0.txt
roda-3.72.0 doc/release_notes/3.71.0.txt
roda-3.71.0 doc/release_notes/3.71.0.txt