Module: Roda::RodaPlugins::ParamMatchers::RequestMethods

Defined in:
lib/roda/plugins/param_matchers.rb

Instance Method Summary collapse

Instance Method Details

#match_param(key) ⇒ Object

Match the given parameter if present, even if the parameter is empty. Adds any match to the captures.



25
26
27
28
29
# File 'lib/roda/plugins/param_matchers.rb', line 25

def match_param(key)
  if v = self[key]
    @captures << v
  end
end

#match_param!(key) ⇒ Object

Match the given parameter if present and not empty. Adds any match to the captures.



33
34
35
36
37
# File 'lib/roda/plugins/param_matchers.rb', line 33

def match_param!(key)
  if (v = self[key]) && !v.empty?
    @captures << v
  end
end