module Roda::RodaPlugins::ClassMatchers::RequestMethods

  1. lib/roda/plugins/class_matchers.rb

Methods

Public Instance

  1. _consume_segment

Public Instance methods

_consume_segment(convert_meth)

Use faster approach for segment matching. This is used for matchers based on the String class matcher, and avoids the use of regular expressions for scanning.

[show source]
    # File lib/roda/plugins/class_matchers.rb
138 def _consume_segment(convert_meth)
139   rp = @remaining_path
140   if _match_class_String
141     if convert_meth
142       if captures = scope.send(convert_meth, @captures.pop)
143         if captures.is_a?(Array)
144           @captures.concat(captures)
145         else
146           @captures << captures
147         end
148       else
149         @remaining_path = rp
150         nil
151       end
152     else
153       true
154     end
155   end
156 end