module Roda::RodaPlugins::ParamMatchers::RequestMethods
Public Instance Methods
Source
# File lib/roda/plugins/param_matchers.rb, line 49 def match_param(key) if v = params[key.to_s] @captures << v end end
Match the given parameter if present, even if the parameter is empty. Adds match to the captures.
Source
# File lib/roda/plugins/param_matchers.rb, line 57 def match_param!(key) if (v = params[key.to_s]) && !v.empty? @captures << v end end
Match the given parameter if present and not empty. Adds match to the captures.
Source
# File lib/roda/plugins/param_matchers.rb, line 65 def match_params(keys) keys.each do |key| return false unless match_param(key) end end
Match all given parameters if present, even if any/all parameters is empty. Adds all matches to the captures.
Source
# File lib/roda/plugins/param_matchers.rb, line 73 def match_params!(keys) keys.each do |key| return false unless match_param!(key) end end
Match all given parameters if present and not empty. Adds all matches to the captures.