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