module Roda::RodaPlugins::PathMatchers::RequestMethods

  1. lib/roda/plugins/path_matchers.rb

Methods

Public Instance

  1. match_extension
  2. match_prefix
  3. match_suffix

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
40 def match_extension(ext)
41   match_suffix("\\.#{ext}")
42 end
match_prefix(prefix)

Match when the current path segment starts with the given prefix.

[show source]
   # File lib/roda/plugins/path_matchers.rb
45 def match_prefix(prefix)
46   consume(self.class.cached_matcher([:prefix, prefix]){/#{prefix}([^\\\/]+)/})
47 end
match_suffix(suffix)

Match when the current path segment ends with the given suffix.

[show source]
   # File lib/roda/plugins/path_matchers.rb
50 def match_suffix(suffix)
51   consume(self.class.cached_matcher([:suffix, suffix]){/([^\\\/]+)#{suffix}/})
52 end