module Roda::RodaPlugins::HashMatcher

  1. lib/roda/plugins/hash_matcher.rb

The hash_matcher plugin adds the hash_matcher class method, which allows for easily defining hash matchers:

class App < Roda
  hash_matcher(:foo) do |v|
    params['foo'] == v
  end

  route do
    r.on foo: 'bar' do
      # matches when param foo has value bar
    end
  end
end