module Roda::RodaPlugins::Base::RequestClassMethods

  1. lib/roda/request.rb

Class methods for RodaRequest

Attributes

match_pattern_cache [RW]

The cache to use for match patterns for this request class.

roda_class [RW]

Reference to the Roda class related to this request class.

Public Instance methods

cached_matcher(obj)

Return the cached pattern for the given object. If the object is not already cached, yield to get the basic pattern, and convert the basic pattern to a pattern that does not match partial segments.

[show source]
   # File lib/roda/request.rb
39 def cached_matcher(obj)
40   cache = @match_pattern_cache
41 
42   unless pattern = cache[obj]
43     pattern = cache[obj] = consume_pattern(yield)
44   end
45 
46   pattern
47 end
inspect()

Since RodaRequest is anonymously subclassed when Roda is subclassed, and then assigned to a constant of the Roda subclass, make inspect reflect the likely name for the class.

[show source]
   # File lib/roda/request.rb
52 def inspect
53   "#{roda_class.inspect}::RodaRequest"
54 end