Public Instance methods
match_extension(ext)
Match when the current segment ends with the given extension. request path end with the extension.
[show source]
# File lib/roda/plugins/path_matchers.rb 36 def match_extension(ext) 37 match_suffix(".#{ext}") 38 end
match_prefix(prefix)
Match when the current path segment starts with the given prefix.
[show source]
# File lib/roda/plugins/path_matchers.rb 41 def match_prefix(prefix) 42 consume(self.class.cached_matcher([:prefix, prefix]){/#{prefix}([^\\\/]+)/}) 43 end
match_suffix(suffix)
Match when the current path segment ends with the given suffix.
[show source]
# File lib/roda/plugins/path_matchers.rb 46 def match_suffix(suffix) 47 consume(self.class.cached_matcher([:suffix, suffix]){/([^\\\/]+)#{suffix}/}) 48 end